diff --git a/.gitattributes b/.gitattributes index 7d100b0..e160014 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,3 +5,4 @@ /phpunit.xml export-ignore /phpcs.xml.dist export-ignore /tests export-ignore +/DEV.md export-ignore \ No newline at end of file diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 1316e03..2318912 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -7,8 +7,8 @@ jobs: strategy: max-parallel: 1 matrix: - operating-system: [ubuntu-18.04, ubuntu-20.04] - php-versions: ['7.4'] + operating-system: [ubuntu-latest, ubuntu-20.04] + php-versions: ["7.4", "8.1", "8.2"] runs-on: ${{ matrix.operating-system }} @@ -23,6 +23,9 @@ jobs: - name: Validate composer.json and composer.lock run: composer validate + - name: Update lock file + run: composer update + - name: Cache Composer packages id: composer-cache uses: actions/cache@v2 @@ -34,7 +37,7 @@ jobs: - name: Install dependencies if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --prefer-dist --no-progress + run: composer install --prefer-dist --no-progress - name: Run test suites run: ./vendor/bin/phpunit --coverage-clover coverage.xml diff --git a/.gitignore b/.gitignore index 76840a9..af53452 100644 --- a/.gitignore +++ b/.gitignore @@ -3,24 +3,31 @@ index.php .DS_Store -# Ignore PHPUnit coverage file +# Ignore PHPUnit coverage files and directories clover.xml clover/ +coverage_html # PHP CS Fixer .php_cs .php_cs.cache # PHPUnit -.phpunit.result.cache +.phpunit.cache # Build data /build/ /vendor/ +/node_modules +package-lock.json +package.json # phpDocumenter .phpdoc/* phpdoc.xml .pytest_cache -index.php \ No newline at end of file +index.php + +# IDE config +.vscode \ No newline at end of file diff --git a/.phpunit.result.cache b/.phpunit.result.cache new file mode 100644 index 0000000..ba7a563 --- /dev/null +++ b/.phpunit.result.cache @@ -0,0 +1 @@ +{"version":1,"defects":{"ComplyCube\\Tests\\Integration\\AccountInfoTest::testGetAccountInfo":8,"ComplyCube\\Tests\\Integration\\AddressTest::testCreatePersonForAddress":8,"ComplyCube\\Tests\\Integration\\AddressTest::testGetNonExistentAddress":7,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddress":1,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddressInvalidType":1,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateInvalidCountryAddress":1,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddressMissingLine":1,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddressInLine":1,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddressMissingCity":1,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddressMissingCountry":1,"ComplyCube\\Tests\\Integration\\AddressTest::testGetAddress":1,"ComplyCube\\Tests\\Integration\\AddressTest::testUpdateAddress":1,"ComplyCube\\Tests\\Integration\\AddressTest::testUpdateAddressInvalidCountryCode":1,"ComplyCube\\Tests\\Integration\\AddressTest::testListAddress":1,"ComplyCube\\Tests\\Integration\\AddressTest::testList2AddressesOnly":1,"ComplyCube\\Tests\\Integration\\AddressTest::testFilterAddressesLondonOnly":1,"ComplyCube\\Tests\\Integration\\AddressTest::testSearchAddress":7,"ComplyCube\\Tests\\Integration\\AddressTest::testDeleteAddress":1,"ComplyCube\\Tests\\Integration\\AuditLogTest::testListAuditLogs":8,"ComplyCube\\Tests\\Integration\\AuditLogTest::testListOnly10AuditLogs":8,"ComplyCube\\Tests\\Integration\\AuditLogTest::testFilterUpdateOnly":8,"ComplyCube\\Tests\\Integration\\AuditLogTest::testGetAuditLog":1,"ComplyCube\\Tests\\Integration\\CheckTest::testCreatePersonClient":8,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateDocument":1,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateAddress":1,"ComplyCube\\Tests\\Integration\\CheckTest::testUploadImageToDocument":1,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateDocumentCheck":1,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateExtensiveCheck":1,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateStandardCheck":1,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateStandardCheckWithOptions":1,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateInvalidCheck":1,"ComplyCube\\Tests\\Integration\\CheckTest::testGetCheckById":1,"ComplyCube\\Tests\\Integration\\CheckTest::testCreatePoACheck":1,"ComplyCube\\Tests\\Integration\\CheckTest::testValidateCheckByIdInline":1,"ComplyCube\\Tests\\Integration\\CheckTest::testValidateCheckById":1,"ComplyCube\\Tests\\Integration\\CheckTest::testUpdateCheck":1,"ComplyCube\\Tests\\Integration\\CheckTest::testListChecks":8,"ComplyCube\\Tests\\Integration\\CheckTest::testList2ChecksOnly":1,"ComplyCube\\Tests\\Integration\\CheckTest::testFilterExtensiveChecksOnly":8,"ComplyCube\\Tests\\Integration\\ClientTest::testCreatePersonInline":8,"ComplyCube\\Tests\\Integration\\ClientTest::testCreatePersonClient":8,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateCompanyClient":8,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateCompanyClientWithValidWebsite":8,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateCompanyClientWithValidWebsite":1,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateClientWithValidMetadata":8,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateClientWithValidMetadataInline":8,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithValidMetadata":1,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithValidMetadataInline":1,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithMetadataContainingNonStringKeys":1,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithMetadataContainingNonStringValues":1,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithMetadataContainingInvalidLengthKeys":1,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithMetadataContainingInvalidLengthValues":1,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithMetadataEntriesExceedingCountLimit":1,"ComplyCube\\Tests\\Integration\\ClientTest::testGetNonExistentPersonById":7,"ComplyCube\\Tests\\Integration\\ClientTest::testGetPersonById":1,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdatePerson":1,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdatePersonWithUselessInformation":1,"ComplyCube\\Tests\\Integration\\ClientTest::testDeletePerson":1,"ComplyCube\\Tests\\Integration\\ClientTest::testListPersons":1,"ComplyCube\\Tests\\Integration\\ClientTest::testList2PersonsOnly":1,"ComplyCube\\Tests\\Integration\\ClientTest::testFilterCompaniesOnly":8,"ComplyCube\\Tests\\Integration\\CompanyTest::testSearchCompany":7,"ComplyCube\\Tests\\Integration\\CompanyTest::testGetCompanyDetails":7,"ComplyCube\\Tests\\Integration\\CustomListTest::testGetCustomList":8,"ComplyCube\\Tests\\Integration\\CustomListTest::testAddPersonEntityToCustomList":1,"ComplyCube\\Tests\\Integration\\CustomListTest::testAddInvalidPersonEntityToCustomList":1,"ComplyCube\\Tests\\Integration\\CustomListTest::testAddCompanyEntityToCustomList":1,"ComplyCube\\Tests\\Integration\\CustomListTest::testAddInvalidCompanyEntityToCustomList":1,"ComplyCube\\Tests\\Integration\\CustomListTest::testListCustomLists":8,"ComplyCube\\Tests\\Integration\\DocumentTest::testCreatePersonForDocument":8,"ComplyCube\\Tests\\Integration\\DocumentTest::testCreateDocument":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testCreateDocumentInline":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testCreateDocumentWithMissingType":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testCreateDocumentWithInvalidType":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testGetDocument":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testGetNonExistentDocument":7,"ComplyCube\\Tests\\Integration\\DocumentTest::testUpdateDocumentType":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testUpdateDocumentInvalidType":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testUploadImageToDocument":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testUploadImageToDocumentInline":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testUploadImageToDocumentInvalidSide":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testUploadImageToDocumentNoFilename":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testUploadImageToDocumentNoData":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testDownloadImageFromDocument":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testDownloadImageFromDocumentInvalidSide":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testDeleteImageFromDocument":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testListDocuments":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testList2DocumentsOnly":1,"ComplyCube\\Tests\\Integration\\DocumentTest::testFilterPassportDocumentsOnly":1,"ComplyCube\\Tests\\Integration\\FlowSessionTest::testCreatePersonForSession":8,"ComplyCube\\Tests\\Integration\\FlowSessionTest::testCreateFlowSession":1,"ComplyCube\\Tests\\Integration\\FlowSessionTest::testCreateFlowSessionInline":1,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testCreatePersonForDocument":8,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testUploadLivePhoto":1,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testUploadLivePhotoInline":1,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testDownloadLivePhoto":1,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testListLivePhotos":1,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testList2LivePhotosOnly":1,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testDeleteLivePhoto":1,"ComplyCube\\Tests\\Integration\\LiveVideoTest::testCreatePersonForVideo":8,"ComplyCube\\Tests\\Integration\\LiveVideoTest::testCreateLiveVideo":1,"ComplyCube\\Tests\\Integration\\LiveVideoTest::testGetLiveVideo":1,"ComplyCube\\Tests\\Integration\\LiveVideoTest::testListLiveVideo":1,"ComplyCube\\Tests\\Integration\\LiveVideoTest::testDeleteLivePhoto":1,"ComplyCube\\Tests\\Integration\\ReportTest::testCreatePersonClient":8,"ComplyCube\\Tests\\Integration\\ReportTest::testCreateSimpleCheck":1,"ComplyCube\\Tests\\Integration\\ReportTest::testGenerateClientReport":1,"ComplyCube\\Tests\\Integration\\ReportTest::testGenerateCheckReport":1,"ComplyCube\\Tests\\Integration\\RiskProfileTest::testCreatePersonForDocument":8,"ComplyCube\\Tests\\Integration\\RiskProfileTest::testGetRiskProfile":1,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testCreatePersonClient":8,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateWebSDKToken":1,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateMobileSDKToken":1,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateWebSDKTokenWithInvalidClientId":1,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateMobileSDKTokenWithInvalidClientId":1,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateTokenWithInvalidReferrerOrAppId":1,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateTokenWithNullSDKInfo":1,"ComplyCube\\Tests\\Integration\\StaticTest::testScreeningLists":8,"ComplyCube\\Tests\\Integration\\StaticTest::testSupportedDocuments":8,"ComplyCube\\Tests\\Integration\\TeamMemberTest::testListTeamMembers":8,"ComplyCube\\Tests\\Integration\\TeamMemberTest::testGetTeamMember":1,"ComplyCube\\Tests\\Integration\\TeamMemberTest::testFilterTeamMember":1,"ComplyCube\\Tests\\Integration\\WebhookTest::testCreateWebhook":8,"ComplyCube\\Tests\\Integration\\WebhookTest::testUpdateWebhookInline":1,"ComplyCube\\Tests\\Integration\\WebhookTest::testUpdateWebhook":1,"ComplyCube\\Tests\\Integration\\WebhookTest::testGetWebhook":1,"ComplyCube\\Tests\\Integration\\WebhookTest::testListWebhooks":8,"ComplyCube\\Tests\\Integration\\WebhookTest::testList2HooksOnly":8,"ComplyCube\\Tests\\Integration\\WebhookTest::testFilterEnabledHooksOnly":8,"ComplyCube\\Tests\\Integration\\WebhookTest::testDeleteWebhook":1,"ComplyCube\\Tests\\Integration\\WebhookTest::testClearWebhooks":8},"times":{"ComplyCube\\Tests\\Integration\\AccountInfoTest::testGetAccountInfo":0.682,"ComplyCube\\Tests\\Integration\\AddressTest::testCreatePersonForAddress":0.497,"ComplyCube\\Tests\\Integration\\AddressTest::testGetNonExistentAddress":0.25,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddress":0.195,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddressInvalidType":0.203,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateInvalidCountryAddress":0.233,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddressMissingLine":0.174,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddressInLine":0.234,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddressMissingCity":0.158,"ComplyCube\\Tests\\Integration\\AddressTest::testCreateAddressMissingCountry":0.238,"ComplyCube\\Tests\\Integration\\AddressTest::testGetAddress":0.225,"ComplyCube\\Tests\\Integration\\AddressTest::testUpdateAddress":0.175,"ComplyCube\\Tests\\Integration\\AddressTest::testUpdateAddressInvalidCountryCode":0.15,"ComplyCube\\Tests\\Integration\\AddressTest::testListAddress":0.227,"ComplyCube\\Tests\\Integration\\AddressTest::testList2AddressesOnly":0.648,"ComplyCube\\Tests\\Integration\\AddressTest::testFilterAddressesLondonOnly":0.18,"ComplyCube\\Tests\\Integration\\AddressTest::testSearchAddress":0.504,"ComplyCube\\Tests\\Integration\\AddressTest::testSearchAddressWithInvalidParameters":0.324,"ComplyCube\\Tests\\Integration\\AddressTest::testDeleteAddress":0.314,"ComplyCube\\Tests\\Integration\\AuditLogTest::testListAuditLogs":2.373,"ComplyCube\\Tests\\Integration\\AuditLogTest::testListOnly10AuditLogs":0.488,"ComplyCube\\Tests\\Integration\\AuditLogTest::testFilterUpdateOnly":0.323,"ComplyCube\\Tests\\Integration\\AuditLogTest::testGetAuditLog":0.169,"ComplyCube\\Tests\\Integration\\CheckTest::testCreatePersonClient":0.184,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateDocument":0.265,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateAddress":0.169,"ComplyCube\\Tests\\Integration\\CheckTest::testUploadImageToDocument":3.786,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateDocumentCheck":0.499,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateExtensiveCheck":0.524,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateStandardCheck":0.486,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateStandardCheckWithOptions":0.327,"ComplyCube\\Tests\\Integration\\CheckTest::testCreateInvalidCheck":0.365,"ComplyCube\\Tests\\Integration\\CheckTest::testGetCheckById":0.186,"ComplyCube\\Tests\\Integration\\CheckTest::testCreatePoACheck":0.336,"ComplyCube\\Tests\\Integration\\CheckTest::testValidateCheckByIdInline":5.887,"ComplyCube\\Tests\\Integration\\CheckTest::testValidateCheckById":0.677,"ComplyCube\\Tests\\Integration\\CheckTest::testUpdateCheck":0.322,"ComplyCube\\Tests\\Integration\\CheckTest::testListChecks":0.161,"ComplyCube\\Tests\\Integration\\CheckTest::testList2ChecksOnly":0.69,"ComplyCube\\Tests\\Integration\\CheckTest::testFilterExtensiveChecksOnly":0.257,"ComplyCube\\Tests\\Integration\\ClientTest::testCreatePersonInline":0.176,"ComplyCube\\Tests\\Integration\\ClientTest::testCreatePersonClient":0.216,"ComplyCube\\Tests\\Integration\\ClientTest::testClientMissingEmail":0.15,"ComplyCube\\Tests\\Integration\\ClientTest::testClientMissingType":0.244,"ComplyCube\\Tests\\Integration\\ClientTest::testPersonMissingFirstName":0.239,"ComplyCube\\Tests\\Integration\\ClientTest::testPersonMissingLastName":0.163,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateCompanyClient":0.249,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateCompanyClientWithValidWebsite":0.181,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateCompanyClientWithValidWebsite":0.223,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateClientWithValidMetadata":0.269,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateClientWithValidMetadataInline":0.186,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateClientWithMetadataContainingNonStringKeys":0.188,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateClientWithMetadataContainingNonStringValues":0.153,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateClientWithMetadataContainingInvalidLengthKeys":0.243,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateClientWithMetadataContainingInvalidLengthValues":0.249,"ComplyCube\\Tests\\Integration\\ClientTest::testCreateClientWithMetadataEntriesExceedingCountLimit":0.146,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithValidMetadata":0.256,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithValidMetadataInline":0.18,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithMetadataContainingNonStringKeys":0.24,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithMetadataContainingNonStringValues":0.227,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithMetadataContainingInvalidLengthKeys":0.164,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithMetadataContainingInvalidLengthValues":0.236,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdateClientWithMetadataEntriesExceedingCountLimit":0.186,"ComplyCube\\Tests\\Integration\\ClientTest::testGetNonExistentPersonById":0.207,"ComplyCube\\Tests\\Integration\\ClientTest::testGetPersonById":0.222,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdatePerson":0.292,"ComplyCube\\Tests\\Integration\\ClientTest::testUpdatePersonWithUselessInformation":0.257,"ComplyCube\\Tests\\Integration\\ClientTest::testDeletePerson":0.409,"ComplyCube\\Tests\\Integration\\ClientTest::testListPersons":0.155,"ComplyCube\\Tests\\Integration\\ClientTest::testList2PersonsOnly":0.148,"ComplyCube\\Tests\\Integration\\ClientTest::testFilterCompaniesOnly":0.317,"ComplyCube\\Tests\\Integration\\CompanyTest::testSearchCompany":0.616,"ComplyCube\\Tests\\Integration\\CompanyTest::testSearchCompanyWithInvalidParameters":0.207,"ComplyCube\\Tests\\Integration\\CompanyTest::testGetCompanyDetails":2.756,"ComplyCube\\Tests\\Integration\\CompanyTest::testGetNonExistentCompanyDetails":0.165,"ComplyCube\\Tests\\Integration\\CustomListTest::testGetNonExistentCustomList":0.343,"ComplyCube\\Tests\\Integration\\CustomListTest::testGetCustomList":0.418,"ComplyCube\\Tests\\Integration\\CustomListTest::testAddPersonEntityToCustomList":1.112,"ComplyCube\\Tests\\Integration\\CustomListTest::testAddInvalidPersonEntityToCustomList":0.175,"ComplyCube\\Tests\\Integration\\CustomListTest::testAddCompanyEntityToCustomList":0.384,"ComplyCube\\Tests\\Integration\\CustomListTest::testAddInvalidCompanyEntityToCustomList":0.154,"ComplyCube\\Tests\\Integration\\CustomListTest::testListCustomLists":0.248,"ComplyCube\\Tests\\Integration\\DocumentTest::testCreatePersonForDocument":0.284,"ComplyCube\\Tests\\Integration\\DocumentTest::testCreateDocument":0.154,"ComplyCube\\Tests\\Integration\\DocumentTest::testCreateDocumentInline":0.154,"ComplyCube\\Tests\\Integration\\DocumentTest::testCreateDocumentWithMissingType":0.208,"ComplyCube\\Tests\\Integration\\DocumentTest::testCreateDocumentWithInvalidType":0.147,"ComplyCube\\Tests\\Integration\\DocumentTest::testGetDocument":0.261,"ComplyCube\\Tests\\Integration\\DocumentTest::testGetNonExistentDocument":0.266,"ComplyCube\\Tests\\Integration\\DocumentTest::testUpdateDocumentType":0.194,"ComplyCube\\Tests\\Integration\\DocumentTest::testUpdateDocumentInvalidType":0.181,"ComplyCube\\Tests\\Integration\\DocumentTest::testUploadImageToDocument":3.538,"ComplyCube\\Tests\\Integration\\DocumentTest::testUploadImageToDocumentInline":3.681,"ComplyCube\\Tests\\Integration\\DocumentTest::testUploadImageToDocumentInvalidSide":3.024,"ComplyCube\\Tests\\Integration\\DocumentTest::testUploadImageToDocumentNoFilename":3.487,"ComplyCube\\Tests\\Integration\\DocumentTest::testUploadImageToDocumentNoData":0.156,"ComplyCube\\Tests\\Integration\\DocumentTest::testDownloadImageFromDocument":0.651,"ComplyCube\\Tests\\Integration\\DocumentTest::testDownloadImageFromDocumentInvalidSide":0.812,"ComplyCube\\Tests\\Integration\\DocumentTest::testDownloadImageFromDocumentNonExistentId":0.153,"ComplyCube\\Tests\\Integration\\DocumentTest::testDeleteImageFromDocument":0.138,"ComplyCube\\Tests\\Integration\\DocumentTest::testDeleteImageNonExistentImage":0.217,"ComplyCube\\Tests\\Integration\\DocumentTest::testDeleteNonExistentDocument":0.171,"ComplyCube\\Tests\\Integration\\DocumentTest::testListDocuments":0.371,"ComplyCube\\Tests\\Integration\\DocumentTest::testList2DocumentsOnly":0.472,"ComplyCube\\Tests\\Integration\\DocumentTest::testFilterPassportDocumentsOnly":0.299,"ComplyCube\\Tests\\Integration\\FlowSessionTest::testCreatePersonForSession":0.336,"ComplyCube\\Tests\\Integration\\FlowSessionTest::testCreateFlowSession":0.203,"ComplyCube\\Tests\\Integration\\FlowSessionTest::testCreateFlowSessionInline":0.226,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testCreatePersonForDocument":0.186,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testUploadLivePhoto":3.366,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testUploadLivePhotoInline":3.802,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testDownloadLivePhoto":0.686,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testListLivePhotos":4.079,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testList2LivePhotosOnly":6.132,"ComplyCube\\Tests\\Integration\\LivePhotoTest::testDeleteLivePhoto":0.302,"ComplyCube\\Tests\\Integration\\LiveVideoTest::testCreatePersonForVideo":0.204,"ComplyCube\\Tests\\Integration\\LiveVideoTest::testCreateLiveVideo":0.246,"ComplyCube\\Tests\\Integration\\LiveVideoTest::testGetLiveVideo":0.372,"ComplyCube\\Tests\\Integration\\LiveVideoTest::testListLiveVideo":0.443,"ComplyCube\\Tests\\Integration\\LiveVideoTest::testDeleteLivePhoto":0.378,"ComplyCube\\Tests\\Integration\\ReportTest::testCreatePersonClient":0.236,"ComplyCube\\Tests\\Integration\\ReportTest::testCreateSimpleCheck":0.486,"ComplyCube\\Tests\\Integration\\ReportTest::testGenerateClientReport":2.07,"ComplyCube\\Tests\\Integration\\ReportTest::testGenerateCheckReport":4.457,"ComplyCube\\Tests\\Integration\\RiskProfileTest::testCreatePersonForDocument":0.362,"ComplyCube\\Tests\\Integration\\RiskProfileTest::testGetRiskProfile":0.163,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testCreatePersonClient":0.216,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateWebSDKToken":0.242,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateMobileSDKToken":0.296,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateWebSDKTokenWithInvalidClientId":0.197,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateMobileSDKTokenWithInvalidClientId":0.173,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateTokenWithInvalidReferrerOrAppId":0.261,"ComplyCube\\Tests\\Integration\\SDKTokenTest::testGenerateTokenWithNullSDKInfo":0,"ComplyCube\\Tests\\Integration\\StaticTest::testScreeningLists":0.311,"ComplyCube\\Tests\\Integration\\StaticTest::testSupportedDocuments":0.251,"ComplyCube\\Tests\\Integration\\TeamMemberTest::testListTeamMembers":0.176,"ComplyCube\\Tests\\Integration\\TeamMemberTest::testGetTeamMember":0.192,"ComplyCube\\Tests\\Integration\\TeamMemberTest::testGetNonExistentTeamMember":0.178,"ComplyCube\\Tests\\Integration\\TeamMemberTest::testFilterTeamMember":0.341,"ComplyCube\\Tests\\Integration\\WebhookTest::testCreateWebhook":0.191,"ComplyCube\\Tests\\Integration\\WebhookTest::testUpdateWebhookInline":0.201,"ComplyCube\\Tests\\Integration\\WebhookTest::testUpdateWebhook":0.265,"ComplyCube\\Tests\\Integration\\WebhookTest::testGetWebhook":0.161,"ComplyCube\\Tests\\Integration\\WebhookTest::testListWebhooks":0.449,"ComplyCube\\Tests\\Integration\\WebhookTest::testList2HooksOnly":0.83,"ComplyCube\\Tests\\Integration\\WebhookTest::testFilterEnabledHooksOnly":0.154,"ComplyCube\\Tests\\Integration\\WebhookTest::testDeleteWebhook":0.268,"ComplyCube\\Tests\\Integration\\WebhookTest::testClearWebhooks":16.359,"ComplyCube\\Tests\\Unit\\ApiClientTest::testGetRequest":0,"ComplyCube\\Tests\\Unit\\ApiClientTest::testNullBodyPostRequest":0,"ComplyCube\\Tests\\Unit\\ApiClientTest::testEmptyPostRequest":0,"ComplyCube\\Tests\\Unit\\ApiClientTest::testDeleteRequest":0,"ComplyCube\\Tests\\Unit\\ApiClientTest::testRetryAttemptRequest":0,"ComplyCube\\Tests\\Unit\\ApiClientTest::testClientExceptionRequest":0,"ComplyCube\\Tests\\Unit\\ApiClientTest::testRetryPass":1.005,"ComplyCube\\Tests\\Unit\\ApiClientTest::testRetryFail":0.001,"ComplyCube\\Tests\\Unit\\ApiResourceTest::testAbstractClassType":0,"ComplyCube\\Tests\\Unit\\ApiResponseTest::testNoApiResponse":0,"ComplyCube\\Tests\\Unit\\ApiResponseTest::testSuccessStatusCodeResponse":0,"ComplyCube\\Tests\\Unit\\ApiResponseTest::testHeadersResponse":0,"ComplyCube\\Tests\\Unit\\ApiResponseTest::testBodyResponse":0,"ComplyCube\\Tests\\Unit\\ApiResponseTest::testEmptyApiResponse":0,"ComplyCube\\Tests\\Unit\\ApiResponseTest::testSingleLevelApiResponse":0,"ComplyCube\\Tests\\Unit\\ApiResponseTest::testNestedApiResponse":0,"ComplyCube\\Tests\\Unit\\ApiResponseTest::testInvalidJsonResponse":0,"ComplyCube\\Tests\\Unit\\EventVerifierTest::testNullResponse":0,"ComplyCube\\Tests\\Unit\\EventVerifierTest::testInvalidSignatureEvent":0,"ComplyCube\\Tests\\Unit\\EventVerifierTest::testValidSignatureEvent":0}} \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..91dc503 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,36 @@ +# Local Files +.env +index.php +.DS_Store + +# Ignore PHPUnit coverage files and directories +clover.xml +clover/ +coverage_html + +# PHP CS Fixer +.php_cs +.php_cs.cache + +# PHPUnit +.phpunit.cache + +# Build data +/build/ +/vendor/ +/node_modules +package-lock.json +package.json +composer.lock +.github/workflows/php.yml +README.md + +# phpDocumenter +.phpdoc/* +phpdoc.xml + +.pytest_cache +index.php + +# IDE config +.vscode \ No newline at end of file diff --git a/DEV.md b/DEV.md new file mode 100644 index 0000000..0ad8c25 --- /dev/null +++ b/DEV.md @@ -0,0 +1 @@ +# ComplyCube PHP Dev Library \ No newline at end of file diff --git a/VERSION b/VERSION index 8cfbc90..9c1218c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.1 \ No newline at end of file +1.1.3 \ No newline at end of file diff --git a/composer.json b/composer.json index 8910cb6..b7777d0 100644 --- a/composer.json +++ b/composer.json @@ -18,13 +18,15 @@ ], "require": { "php": ">=7.4", - "caseyamcl/guzzle_retry_middleware": "^2.6", - "guzzlehttp/guzzle": "^7.3" + "caseyamcl/guzzle_retry_middleware": "^2.8.0", + "guzzlehttp/guzzle": "^7.5.0", + "nesbot/carbon": "^2.66" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.17", - "phpunit/phpunit": ">=8.0", - "squizlabs/php_codesniffer": "^3.5" + "friendsofphp/php-cs-fixer": "^3.16.0", + "phpunit/phpunit": ">=9.6.6", + "squizlabs/php_codesniffer": "^3.7.2", + "symfony/var-dumper": ">=5.4.22" }, "autoload": { "psr-4": { @@ -37,7 +39,10 @@ } }, "scripts": { - "test": "phpunit", + "test": [ + "Composer\\Config::disableProcessTimeout", + "phpunit" + ], "check-style": "phpcs lib tests", "fix-style": "phpcbf lib tests" }, diff --git a/composer.lock b/composer.lock index 491b6e8..598e072 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "86c822c74e8b05e9e63107ea91d7f86d", + "content-hash": "5b74d15c7b3082028215897c74bfa300", "packages": [ { "name": "caseyamcl/guzzle_retry_middleware", - "version": "v2.6.1", + "version": "v2.9.0", "source": { "type": "git", "url": "https://github.com/caseyamcl/guzzle_retry_middleware.git", - "reference": "2d6c8e0bdc0c7102b3000ca157f535da48bd0bd0" + "reference": "cbec4ce59c2dbd200a11aed19e7c26c37e50e535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/caseyamcl/guzzle_retry_middleware/zipball/2d6c8e0bdc0c7102b3000ca157f535da48bd0bd0", - "reference": "2d6c8e0bdc0c7102b3000ca157f535da48bd0bd0", + "url": "https://api.github.com/repos/caseyamcl/guzzle_retry_middleware/zipball/cbec4ce59c2dbd200a11aed19e7c26c37e50e535", + "reference": "cbec4ce59c2dbd200a11aed19e7c26c37e50e535", "shasum": "" }, "require": { @@ -28,7 +28,7 @@ "jaschilz/php-coverage-badger": "^2.0", "nesbot/carbon": "^2.0", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12", + "phpstan/phpstan": "^1.0", "phpunit/phpunit": "^7.5|^8.0|^9.0", "squizlabs/php_codesniffer": "^3.5" }, @@ -68,40 +68,47 @@ ], "support": { "issues": "https://github.com/caseyamcl/guzzle_retry_middleware/issues", - "source": "https://github.com/caseyamcl/guzzle_retry_middleware/tree/v2.6.1" + "source": "https://github.com/caseyamcl/guzzle_retry_middleware/tree/v2.9.0" }, - "time": "2020-11-27T19:10:19+00:00" + "funding": [ + { + "url": "https://github.com/caseyamcl", + "type": "github" + } + ], + "time": "2023-08-30T18:02:31+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.4.0", + "version": "7.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94" + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/868b3571a039f0ebc11ac8f344f4080babe2cb94", - "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2" + "symfony/deprecation-contracts": "^2.2 || ^3.0" }, "provide": { "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "ext-curl": "*", - "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -111,17 +118,18 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "7.4-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -178,7 +186,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.0" + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" }, "funding": [ { @@ -194,41 +202,40 @@ "type": "tidelift" } ], - "time": "2021-10-18T09:52:00+00:00" + "time": "2023-08-27T10:20:53+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { "psr-4": { "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -262,7 +269,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" + "source": "https://github.com/guzzle/promises/tree/2.0.1" }, "funding": [ { @@ -278,26 +285,26 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:56:57+00:00" + "time": "2023-08-03T15:11:55+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.1.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.1 || ^2.0", "ralouphie/getallheaders": "^3.0" }, "provide": { @@ -305,17 +312,18 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.8 || ^9.3.10" + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.1-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { @@ -377,7 +385,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.1.0" + "source": "https://github.com/guzzle/psr7/tree/2.6.1" }, "funding": [ { @@ -393,25 +401,179 @@ "type": "tidelift" } ], - "time": "2021-10-06T17:43:30+00:00" + "time": "2023-08-27T10:13:57+00:00" + }, + { + "name": "nesbot/carbon", + "version": "2.71.0", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "98276233188583f2ff845a0f992a235472d9466a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/98276233188583f2ff845a0f992a235472d9466a", + "reference": "98276233188583f2ff845a0f992a235472d9466a", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "psr/clock": "^1.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "doctrine/dbal": "^2.0 || ^3.1.4", + "doctrine/orm": "^2.7", + "friendsofphp/php-cs-fixer": "^3.0", + "kylekatarnls/multi-tester": "^2.0", + "ondrejmirtes/better-reflection": "*", + "phpmd/phpmd": "^2.9", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.99 || ^1.7.14", + "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", + "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", + "squizlabs/php_codesniffer": "^3.4" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.x-dev", + "dev-master": "2.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "time": "2023-09-25T11:31:05+00:00" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" }, { "name": "psr/http-client", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", "shasum": "" }, "require": { "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -431,7 +593,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -443,27 +605,27 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/master" + "source": "https://github.com/php-fig/http-client" }, - "time": "2020-06-29T06:28:15+00:00" + "time": "2023-09-23T14:17:50+00:00" }, { "name": "psr/http-factory", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "e616d01114759c4c489f93b099585439f795fe35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", "shasum": "" }, "require": { "php": ">=7.0.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -483,7 +645,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for PSR-7 HTTP message factories", @@ -498,31 +660,31 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" }, - "time": "2019-04-30T12:38:16+00:00" + "time": "2023-04-10T20:10:41+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -537,7 +699,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -551,9 +713,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "ralouphie/getallheaders", @@ -601,25 +763,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.4.0", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -648,7 +810,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" }, "funding": [ { @@ -664,40 +826,47 @@ "type": "tidelift" } ], - "time": "2021-03-23T23:28:01+00:00" - } - ], - "packages-dev": [ + "time": "2023-05-23T14:45:45+00:00" + }, { - "name": "composer/semver", - "version": "3.2.6", + "name": "symfony/polyfill-mbstring", + "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "83e511e247de329283478496f7a1e114c9517506" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", - "reference": "83e511e247de329283478496f7a1e114c9517506", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": ">=7.1" }, - "require-dev": { - "phpstan/phpstan": "^0.12.54", - "symfony/phpunit-bridge": "^4.2 || ^5" + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.x-dev" + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Composer\\Semver\\": "src" + "Symfony\\Polyfill\\Mbstring\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -706,76 +875,79 @@ ], "authors": [ { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", "keywords": [ - "semantic", - "semver", - "validation", - "versioning" + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" ], "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.6" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { - "url": "https://packagist.com", + "url": "https://symfony.com/sponsor", "type": "custom" }, { - "url": "https://github.com/composer", + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-10-25T11:34:17+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { - "name": "composer/xdebug-handler", - "version": "2.0.2", + "name": "symfony/polyfill-php80", + "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "php": ">=7.1" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Composer\\XdebugHandler\\": "src" - } + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -783,68 +955,104 @@ ], "authors": [ { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Restarts a process without Xdebug.", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "Xdebug", - "performance" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { - "url": "https://packagist.com", + "url": "https://symfony.com/sponsor", "type": "custom" }, { - "url": "https://github.com/composer", + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2021-07-31T17:03:58+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { - "name": "doctrine/annotations", - "version": "1.13.2", + "name": "symfony/translation", + "version": "v6.3.3", "source": { "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08" + "url": "https://github.com/symfony/translation.git", + "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08", + "url": "https://api.github.com/repos/symfony/translation/zipball/3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", + "reference": "3ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^2.5|^3.0" + }, + "conflict": { + "symfony/config": "<5.4", + "symfony/console": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<5.4", + "symfony/service-contracts": "<2.5", + "symfony/twig-bundle": "<5.4", + "symfony/yaml": "<5.4" + }, + "provide": { + "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2" + "nikic/php-parser": "^4.13", + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/finder": "^5.4|^6.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/intl": "^5.4|^6.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/routing": "^5.4|^6.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^5.4|^6.0" }, "type": "library", "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -852,69 +1060,146 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v6.3.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-31T07:08:24+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "02c24deb352fb0d79db5486c0c79905a85e37e86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/02c24deb352fb0d79db5486c0c79905a85e37e86", + "reference": "02c24deb352fb0d79db5486c0c79905a85e37e86", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", "keywords": [ - "annotations", - "docblock", - "parser" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.2" + "source": "https://github.com/symfony/translation-contracts/tree/v3.3.0" }, - "time": "2021-08-05T19:00:23+00:00" - }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-30T17:17:10+00:00" + } + ], + "packages-dev": [ { - "name": "doctrine/instantiator", - "version": "1.4.0", + "name": "composer/pcre", + "version": "3.1.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "url": "https://github.com/composer/pcre.git", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "Composer\\Pcre\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -923,68 +1208,68 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", "keywords": [ - "constructor", - "instantiate" + "PCRE", + "preg", + "regex", + "regular expression" ], "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.0" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" + "url": "https://github.com/composer", + "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2022-11-17T09:50:14+00:00" }, { - "name": "doctrine/lexer", - "version": "1.2.1", + "name": "composer/semver", + "version": "3.4.0", "source": { "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Composer\\Semver\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -993,128 +1278,176 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" }, { - "name": "Roman Borschel", - "email": "roman@code-factory.org" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" } ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-31T09:50:34+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "ced299686f41dce890debac69273b47ffe98a40c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" ], "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.1" + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" + "url": "https://github.com/composer", + "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2020-05-25T17:44:05+00:00" + "time": "2022-02-25T21:32:43+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.2", + "version": "v3.30.0", "source": { "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "d5c737c2e18ba502b75b44832b31fe627f82e307" + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "95c64693b2f149966a2bc05a7a4981b0343ea52f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/d5c737c2e18ba502b75b44832b31fe627f82e307", - "reference": "d5c737c2e18ba502b75b44832b31fe627f82e307", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/95c64693b2f149966a2bc05a7a4981b0343ea52f", + "reference": "95c64693b2f149966a2bc05a7a4981b0343ea52f", "shasum": "" }, "require": { - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2 || ^2.0", - "doctrine/annotations": "^1.2", + "composer/semver": "^3.3", + "composer/xdebug-handler": "^3.0.3", "ext-json": "*", "ext-tokenizer": "*", - "php": "^5.6 || ^7.0 || ^8.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", - "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^3.0 || ^4.0 || ^5.0", - "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0 || ^5.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", + "symfony/polyfill-mbstring": "^1.27", + "symfony/polyfill-php80": "^1.27", + "symfony/polyfill-php81": "^1.27", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" }, "require-dev": { - "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.4", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.2", - "php-cs-fixer/accessible-object": "^1.0", + "facile-it/paraunit": "^1.3 || ^2.0", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.0", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.5.3", + "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", - "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.2.1", - "symfony/yaml": "^3.0 || ^4.0 || ^5.0" + "phpspec/prophecy": "^1.16", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "phpunitgoodpractices/polyfill": "^1.6", + "phpunitgoodpractices/traits": "^1.9.2", + "symfony/phpunit-bridge": "^6.2.3", + "symfony/yaml": "^5.4 || ^6.0" }, "suggest": { "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + "ext-mbstring": "For handling non-UTF8 characters." }, "bin": [ "php-cs-fixer" ], "type": "application", - "extra": { - "branch-alias": { - "dev-master": "2.19-dev" - } - }, "autoload": { "psr-4": { "PhpCsFixer\\": "src/" - }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/Test/TokensWithObservedTransformers.php", - "tests/TestCase.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1131,9 +1464,15 @@ } ], "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.2" + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.30.0" }, "funding": [ { @@ -1141,41 +1480,42 @@ "type": "github" } ], - "time": "2021-08-18T19:55:46+00:00" + "time": "2023-09-26T22:10:43+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.10.2", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, - "replace": { - "myclabs/deep-copy": "self.version" + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ "src/DeepCopy/deep_copy.php" - ] + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1191,7 +1531,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -1199,20 +1539,20 @@ "type": "tidelift" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "nikic/php-parser", - "version": "v4.13.0", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "50953a2691a922aa1769461637869a0a2faa3f53" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", - "reference": "50953a2691a922aa1769461637869a0a2faa3f53", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -1253,9 +1593,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" }, - "time": "2021-09-20T12:20:58+00:00" + "time": "2023-08-13T19:53:39+00:00" }, { "name": "phar-io/manifest", @@ -1319,16 +1659,16 @@ }, { "name": "phar-io/version", - "version": "3.1.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "bae7c545bef187884426f042434e561ab1ddb182" + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", - "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { @@ -1364,32 +1704,52 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.1.0" + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2021-02-23T14:00:09+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { - "name": "php-cs-fixer/diff", - "version": "v1.3.1", + "name": "phpunit/php-code-coverage", + "version": "10.1.6", "source": { "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "56f33548fe522c8d82da7ff3824b42829d324364" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/56f33548fe522c8d82da7ff3824b42829d324364", + "reference": "56f33548fe522c8d82da7ff3824b42829d324364", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0 || ^8.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.15", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", + "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" + "phpunit/phpunit": "^10.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.1-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -1402,382 +1762,82 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "SpacePossum" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "sebastian/diff v2 backport support for PHP5.6", - "homepage": "https://github.com/PHP-CS-Fixer", + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ - "diff" + "coverage", + "testing", + "xunit" ], "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.6" }, - "time": "2020-10-14T08:39:05+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-09-19T04:59:03+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "phpunit/php-file-iterator", + "version": "4.1.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-2.x": "2.x-dev" + "dev-main": "4.0-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "filesystem", + "iterator" ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" - }, - "time": "2021-10-02T14:08:47+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.14.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", - "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.14.0" - }, - "time": "2021-09-10T09:02:12+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "9.2.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cf04e88a2e3c56fc1a65488afd493325b4c1bc3e", - "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-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": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-10-30T08:01:38+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", - "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-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": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -1785,28 +1845,28 @@ "type": "github" } ], - "time": "2020-09-28T05:57:25+00:00" + "time": "2023-08-31T06:24:48+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcntl": "*" @@ -1814,7 +1874,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1840,7 +1900,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" }, "funding": [ { @@ -1848,32 +1908,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2023-02-03T06:56:09+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1899,7 +1959,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -1907,32 +1968,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-08-31T14:07:24+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1958,7 +2019,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" }, "funding": [ { @@ -1966,24 +2027,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2023-02-03T06:57:52+00:00" }, { "name": "phpunit/phpunit", - "version": "9.5.10", + "version": "10.3.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" + "reference": "747c3b2038f1139e3dcd9886a3f5a948648b7503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", - "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/747c3b2038f1139e3dcd9886a3f5a948648b7503", + "reference": "747c3b2038f1139e3dcd9886a3f5a948648b7503", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -1993,32 +2053,26 @@ "myclabs/deep-copy": "^1.10.1", "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.7", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3.4", - "sebastian/version": "^3.0.2" - }, - "require-dev": { - "ext-pdo": "*", - "phpspec/prophecy-phpunit": "^2.0.1" + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.5", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.1", + "sebastian/global-state": "^6.0.1", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -2026,15 +2080,15 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-main": "10.3-dev" } }, "autoload": { - "classmap": [ - "src/" - ], "files": [ "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2057,46 +2111,51 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.3.5" }, "funding": [ { - "url": "https://phpunit.de/donate.html", + "url": "https://phpunit.de/sponsors.html", "type": "custom" }, { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2021-09-25T07:38:51+00:00" + "time": "2023-09-19T05:42:37+00:00" }, { - "name": "psr/cache", - "version": "1.0.1", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Cache\\": "src/" + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2106,41 +2165,50 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], - "description": "Common interface for caching libraries", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "cache", - "psr", - "psr-6" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], "support": { - "source": "https://github.com/php-fig/cache/tree/master" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2016-08-06T20:24:11+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { - "name": "psr/container", - "version": "1.1.1", + "name": "psr/event-dispatcher", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", "shasum": "" }, "require": { "php": ">=7.2.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "Psr\\EventDispatcher\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2150,63 +2218,10 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "homepage": "http://www.php-fig.org/" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" - }, - "time": "2021-03-05T17:36:06+00:00" - }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", + "description": "Standard interfaces for event handling.", "keywords": [ "events", "psr", @@ -2220,30 +2235,30 @@ }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2264,34 +2279,34 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2021-07-14T16:46:02+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2314,7 +2329,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" }, "funding": [ { @@ -2322,32 +2337,32 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2023-02-03T06:58:15+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2370,7 +2385,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" }, "funding": [ { @@ -2378,32 +2393,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2023-02-03T06:58:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2425,7 +2440,7 @@ "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/2.0.3" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" }, "funding": [ { @@ -2433,34 +2448,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2023-02-03T06:59:15+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "2db5010a484d53ebf536087a70b4a5423c102372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", + "reference": "2db5010a484d53ebf536087a70b4a5423c102372", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -2499,7 +2516,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" }, "funding": [ { @@ -2507,33 +2525,33 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2023-08-14T13:18:12+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "c70b73893e10757af9c6a48929fa6a333b56a97a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/c70b73893e10757af9c6a48929fa6a333b56a97a", + "reference": "c70b73893e10757af9c6a48929fa6a333b56a97a", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2556,7 +2574,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.1" }, "funding": [ { @@ -2564,33 +2583,33 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-08-31T09:55:53+00:00" }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^10.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -2622,7 +2641,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" }, "funding": [ { @@ -2630,27 +2650,27 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-01T07:48:21+00:00" }, { "name": "sebastian/environment", - "version": "5.1.3", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -2658,7 +2678,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2677,7 +2697,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -2685,7 +2705,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" }, "funding": [ { @@ -2693,34 +2714,34 @@ "type": "github" } ], - "time": "2020-09-28T05:52:38+00:00" + "time": "2023-04-11T05:39:26+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.3", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/64f51654862e0f5e318db7e9dcc2292c63cdbddc", + "reference": "64f51654862e0f5e318db7e9dcc2292c63cdbddc", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2755,14 +2776,15 @@ } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.1" }, "funding": [ { @@ -2770,38 +2792,35 @@ "type": "github" } ], - "time": "2020-09-28T05:24:23+00:00" + "time": "2023-09-24T13:22:09+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.3", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", - "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2826,7 +2845,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" }, "funding": [ { @@ -2834,33 +2854,33 @@ "type": "github" } ], - "time": "2021-06-11T13:31:12+00:00" + "time": "2023-07-19T07:19:23+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/649e40d279e243d985aa8fb6e74dd5bb28dc185d", + "reference": "649e40d279e243d985aa8fb6e74dd5bb28dc185d", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2883,7 +2903,8 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.1" }, "funding": [ { @@ -2891,34 +2912,34 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-08-31T09:25:50+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -2940,7 +2961,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" }, "funding": [ { @@ -2948,32 +2969,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2023-02-03T07:08:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2995,7 +3016,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, "funding": [ { @@ -3003,32 +3024,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2023-02-03T07:06:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -3055,65 +3076,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:17:30+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.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/3.0.3" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, "funding": [ { @@ -3121,32 +3087,32 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2023-02-03T07:05:40+00:00" }, { "name": "sebastian/type", - "version": "2.3.4", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -3169,7 +3135,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -3177,29 +3143,29 @@ "type": "github" } ], - "time": "2021-06-15T12:49:02+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -3222,7 +3188,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -3230,20 +3196,20 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -3279,63 +3245,55 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "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": "2021-10-11T04:00:11+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "symfony/console", - "version": "v5.3.10", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3" + "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", - "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", + "url": "https://api.github.com/repos/symfony/console/zipball/eca495f2ee845130855ddf1cf18460c38966c8b6", + "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" }, "type": "library", "autoload": { @@ -3364,12 +3322,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.10" + "source": "https://github.com/symfony/console/tree/v6.3.4" }, "funding": [ { @@ -3385,48 +3343,43 @@ "type": "tidelift" } ], - "time": "2021-10-26T09:30:15+00:00" + "time": "2023-08-16T10:10:12+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.3.7", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "ce7b20d69c66a20939d8952b617506a44d102130" + "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ce7b20d69c66a20939d8952b617506a44d102130", - "reference": "ce7b20d69c66a20939d8952b617506a44d102130", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/adb01fe097a4ee930db9258a3cc906b5beb5cf2e", + "reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/event-dispatcher-contracts": "^2", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" + "symfony/event-dispatcher-implementation": "2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "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", - "symfony/stopwatch": "^4.4|^5.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/error-handler": "^5.4|^6.0", + "symfony/expression-language": "^5.4|^6.0", + "symfony/http-foundation": "^5.4|^6.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^5.4|^6.0" }, "type": "library", "autoload": { @@ -3454,7 +3407,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.3.7" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.3.2" }, "funding": [ { @@ -3470,33 +3423,30 @@ "type": "tidelift" } ], - "time": "2021-08-04T21:20:46+00:00" + "time": "2023-07-06T06:56:43+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.4.0", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "69fee1ad2332a7cbab3aca13591953da9cdb7a11" + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/69fee1ad2332a7cbab3aca13591953da9cdb7a11", - "reference": "69fee1ad2332a7cbab3aca13591953da9cdb7a11", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", + "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -3533,7 +3483,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0" }, "funding": [ { @@ -3549,26 +3499,26 @@ "type": "tidelift" } ], - "time": "2021-03-23T23:28:01+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/filesystem", - "version": "v5.3.4", + "version": "v6.3.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32" + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/343f4fe324383ca46792cae728a3b6e2f708fb32", - "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-mbstring": "~1.8" }, "type": "library", "autoload": { @@ -3587,307 +3537,16 @@ { "name": "Fabien Potencier", "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.3.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-07-21T12:40:44+00:00" - }, - { - "name": "symfony/finder", - "version": "v5.3.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a10000ada1e600d109a6c7632e9ac42e8bf2fb93", - "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.3.7" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-08-04T21:20:46+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v5.3.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "4b78e55b179003a42523a362cc0e8327f7a69b5e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4b78e55b179003a42523a362cc0e8327f7a69b5e", - "reference": "4b78e55b179003a42523a362cc0e8327f7a69b5e", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.3.7" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-08-04T21:20:46+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-02-19T12:13:01+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + "source": "https://github.com/symfony/filesystem/tree/v6.3.1" }, "funding": [ { @@ -3903,47 +3562,35 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2023-06-01T08:30:39+00:00" }, { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.23.0", + "name": "symfony/finder", + "version": "v6.3.3", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + "url": "https://github.com/symfony/finder.git", + "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "url": "https://api.github.com/repos/symfony/finder/zipball/9915db259f67d21eefee768c1abcf1cc61b1fc9e", + "reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, - "suggest": { - "ext-intl": "For best performance" + "require-dev": { + "symfony/filesystem": "^6.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + "Symfony\\Component\\Finder\\": "" }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -3952,26 +3599,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + "source": "https://github.com/symfony/finder/tree/v6.3.3" }, "funding": [ { @@ -3987,44 +3626,33 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2023-07-31T08:31:44+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "name": "symfony/options-resolver", + "version": "v6.3.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd", + "reference": "a10f19f5198d589d5c33333cffe98dc9820332dd", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-mbstring": "For best performance" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Component\\OptionsResolver\\": "" }, - "files": [ - "bootstrap.php" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -4033,25 +3661,23 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Provides an improved replacement for the array_replace PHP function", "homepage": "https://symfony.com", "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" + "config", + "configuration", + "options" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/options-resolver/tree/v6.3.0" }, "funding": [ { @@ -4067,59 +3693,73 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2023-05-12T14:21:09+00:00" }, { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", + "name": "symfony/polyfill-ctype", + "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { "php": ">=7.1" }, - "type": "metapackage", + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "ctype", "polyfill", - "portable", - "shim" + "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -4135,29 +3775,32 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { - "name": "symfony/polyfill-php72", - "version": "v1.23.0", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { "php": ">=7.1" }, + "suggest": { + "ext-intl": "For best performance" + }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4165,12 +3808,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4186,16 +3829,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "Symfony polyfill for intl's grapheme_* functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "grapheme", + "intl", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -4211,29 +3856,32 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:17:38+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { - "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { "php": ">=7.1" }, + "suggest": { + "ext-intl": "For best performance" + }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4241,12 +3889,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -4265,16 +3913,18 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill for intl's Normalizer class and related functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "intl", + "normalizer", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -4290,20 +3940,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { - "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "name": "symfony/polyfill-php81", + "version": "v1.28.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", "shasum": "" }, "require": { @@ -4312,7 +3962,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4320,12 +3970,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -4335,10 +3985,6 @@ "MIT" ], "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -4348,7 +3994,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -4357,7 +4003,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" }, "funding": [ { @@ -4373,25 +4019,24 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/process", - "version": "v5.3.7", + "version": "v6.3.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967" + "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/38f26c7d6ed535217ea393e05634cb0b244a1967", - "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967", + "url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54", + "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.1" }, "type": "library", "autoload": { @@ -4419,7 +4064,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.3.7" + "source": "https://github.com/symfony/process/tree/v6.3.4" }, "funding": [ { @@ -4435,33 +4080,33 @@ "type": "tidelift" } ], - "time": "2021-08-04T21:20:46+00:00" + "time": "2023-08-07T10:39:22+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.4.0", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1" + "php": ">=8.1", + "psr/container": "^2.0" }, - "suggest": { - "symfony/service-implementation": "" + "conflict": { + "ext-psr": "<1.1|>=2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -4471,7 +4116,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4498,7 +4146,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" }, "funding": [ { @@ -4514,25 +4162,25 @@ "type": "tidelift" } ], - "time": "2021-04-01T10:43:52+00:00" + "time": "2023-05-23T14:45:45+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.3.4", + "version": "v6.3.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "b24c6a92c6db316fee69e38c80591e080e41536c" + "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b24c6a92c6db316fee69e38c80591e080e41536c", - "reference": "b24c6a92c6db316fee69e38c80591e080e41536c", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", + "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1.0|^2" + "php": ">=8.1", + "symfony/service-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -4560,7 +4208,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.3.4" + "source": "https://github.com/symfony/stopwatch/tree/v6.3.0" }, "funding": [ { @@ -4576,44 +4224,47 @@ "type": "tidelift" } ], - "time": "2021-07-10T08:58:57+00:00" + "time": "2023-02-16T10:14:28+00:00" }, { "name": "symfony/string", - "version": "v5.3.10", + "version": "v6.3.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c" + "reference": "53d1a83225002635bca3482fcbf963001313fb68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", - "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", + "url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68", + "reference": "53d1a83225002635bca3482fcbf963001313fb68", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0", - "symfony/http-client": "^4.4|^5.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, "files": [ "Resources/functions.php" ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, "exclude-from-classmap": [ "/Tests/" ] @@ -4643,7 +4294,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.10" + "source": "https://github.com/symfony/string/tree/v6.3.2" }, "funding": [ { @@ -4659,115 +4310,141 @@ "type": "tidelift" } ], - "time": "2021-10-27T18:21:46+00:00" + "time": "2023-07-05T08:41:27+00:00" }, { - "name": "theseer/tokenizer", - "version": "1.2.1", + "name": "symfony/var-dumper", + "version": "v6.3.4", "source": { "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "url": "https://github.com/symfony/var-dumper.git", + "reference": "2027be14f8ae8eae999ceadebcda5b4909b81d45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2027be14f8ae8eae999ceadebcda5b4909b81d45", + "reference": "2027be14f8ae8eae999ceadebcda5b4909b81d45", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/console": "<5.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^5.4|^6.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/uid": "^5.4|^6.0", + "twig/twig": "^2.13|^3.0.4" }, + "bin": [ + "Resources/bin/var-dump-server" + ], "type": "library", "autoload": { - "classmap": [ - "src/" + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.4" }, "funding": [ { - "url": "https://github.com/theseer", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2023-08-24T14:51:05+00:00" }, { - "name": "webmozart/assert", - "version": "1.10.0", + "name": "theseer/tokenizer", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" } ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" }, - "time": "2021-03-09T10:59:23+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" } ], "aliases": [], diff --git a/examples/EventVerificationSample.php b/examples/EventVerificationSample.php index f429c72..d9e2bc2 100644 --- a/examples/EventVerificationSample.php +++ b/examples/EventVerificationSample.php @@ -1,9 +1,7 @@ httpClient)) { $stack = HandlerStack::create(); - $stack->push(GuzzleRetryMiddleware::factory([ - 'max_retry_attempts' => $maxRetries, - 'default_retry_multiplier' => [ApiClient::class, 'randomJitter']])); - $this->httpClient = new Client(['headers' => [ - 'Authorization' => $apiKey, - 'User-Agent' => 'complycube-php/'.self::VERSION, - 'Content-Type' => 'application/json'], - 'handler' => $stack]); + $stack->push( + GuzzleRetryMiddleware::factory([ + "max_retry_attempts" => $maxRetries, + "default_retry_multiplier" => [ + ApiClient::class, + "randomJitter", + ], + ]) + ); + $this->httpClient = new Client([ + "headers" => [ + "Authorization" => $apiKey, + "User-Agent" => "complycube-php/" . self::VERSION, + "Content-Type" => "application/json", + ], + "handler" => $stack, + ]); } } @@ -56,7 +68,7 @@ public function __construct(string $apiKey, $maxRetries = 0) */ public function get(string $endpoint, array $queryParams = []): ApiResponse { - return $this->sendRequest($endpoint, 'GET', $queryParams); + return $this->sendRequest($endpoint, "GET", $queryParams); } /** @@ -64,12 +76,15 @@ public function get(string $endpoint, array $queryParams = []): ApiResponse * * @param string $endpoint api endpoint class. * @param array $queryParams array of url encoding params. - * @param string $data body of post + * @param mixed $data body of post * @return ApiResponse the result object to map to model. */ - public function post(string $endpoint, array $options, $data = null): ApiResponse - { - return $this->sendRequest($endpoint, 'POST', $options, $data); + public function post( + string $endpoint, + array $options, + $data = null + ): ApiResponse { + return $this->sendRequest($endpoint, "POST", $options, $data); } /** @@ -81,7 +96,7 @@ public function post(string $endpoint, array $options, $data = null): ApiRespons */ public function delete(string $endpoint, array $options = []): void { - $this->sendRequest($endpoint, 'DELETE', $options); + $this->sendRequest($endpoint, "DELETE", $options); } /** @@ -93,19 +108,39 @@ public function delete(string $endpoint, array $options = []): void * @param mixed $data object to be encoded to message body. * @return ApiResponse the result object to map to model. */ - public function sendRequest(string $endpoint, string $method, array $options = [], $data = null): ApiResponse - { - if (\in_array($method, ['POST','PUT'], true)) { - $options['json'] = $data; + public function sendRequest( + string $endpoint, + string $method, + array $options = [], + $data = null + ): ApiResponse { + if (\in_array($method, ["POST", "PUT"], true)) { + $options["json"] = $data; } try { - $rawResponse = $this->httpClient->request($method, $this::BASEURL.'/'.$endpoint, $options); - } catch (\GuzzleHttp\Exception\ClientException $exception) { - throw new ComplyCubeClientException($exception->getMessage(), $exception->getCode(), $exception); - } catch (\GuzzleHttp\Exception\ServerException $exception) { - throw new ComplyCubeServerException($exception->getMessage(), $exception->getCode(), $exception); + $rawResponse = $this->httpClient->request( + $method, + $this::BASEURL . "/" . $endpoint, + $options + ); + } catch (ClientException $exception) { + throw new ComplyCubeClientException( + $exception->getMessage(), + $exception->getCode(), + $exception + ); + } catch (ServerException $exception) { + throw new ComplyCubeServerException( + $exception->getMessage(), + $exception->getCode(), + $exception + ); } - $response = new ApiResponse($rawResponse->getStatusCode(), $rawResponse->getBody(), $rawResponse->getHeaders()); + $response = new ApiResponse( + $rawResponse->getStatusCode(), + $rawResponse->getBody(), + $rawResponse->getHeaders() + ); return $response; } } diff --git a/lib/ApiResource.php b/lib/ApiResource.php index fc22f7b..405814a 100644 --- a/lib/ApiResource.php +++ b/lib/ApiResource.php @@ -2,14 +2,16 @@ namespace ComplyCube; +use ComplyCube\ApiClient; + abstract class ApiResource { - /** @var \ComplyCube\ApiClient $apiClient the ComplyCube API client to use*/ - protected \ComplyCube\ApiClient $apiClient; + /** @var ApiClient $apiClient the ComplyCube API client to use*/ + protected ApiClient $apiClient; /** @var string $resourceClass the model class of returned resource */ protected string $resourceClass; - public function __construct(\ComplyCube\ApiClient $apiClient, string $resourceClass) + public function __construct(ApiClient $apiClient, string $resourceClass) { $this->apiClient = $apiClient; $this->resourceClass = $resourceClass; diff --git a/lib/ApiResponse.php b/lib/ApiResponse.php index 978becd..9c7c2c2 100644 --- a/lib/ApiResponse.php +++ b/lib/ApiResponse.php @@ -7,13 +7,13 @@ class ApiResponse { /** @var integer */ - protected $httpStatusCode; + protected int $httpStatusCode; /** @var string */ - protected $body; + protected ?string $body; /** @var stdClass */ protected $decodedBody; /** @var array */ - protected $headers; + protected array $headers; /** * Api response. @@ -22,8 +22,11 @@ class ApiResponse * @param string|null $body * @param array $headers */ - public function __construct(int $httpStatusCode, ?string $body = null, array $headers = []) - { + public function __construct( + int $httpStatusCode, + ?string $body = null, + array $headers = [] + ) { $this->httpStatusCode = $httpStatusCode; $this->body = $body; $this->headers = $headers; @@ -78,14 +81,16 @@ public function getHeaders(): array private function decodeBody(): void { if (empty($this->body) || $this->body === null) { - $this->decodedBody = (objecT)[]; + $this->decodedBody = (object) []; return; } $this->decodedBody = json_decode($this->body); if (json_last_error() !== JSON_ERROR_NONE) { - throw new \JsonException('The body of the response could not be decoded as JSON.'); + throw new \JsonException( + "The body of the response could not be decoded as JSON." + ); } } } diff --git a/lib/ComplyCubeClient.php b/lib/ComplyCubeClient.php index 774d0a5..d4fa11d 100644 --- a/lib/ComplyCubeClient.php +++ b/lib/ComplyCubeClient.php @@ -3,24 +3,43 @@ namespace ComplyCube; use ComplyCube\ApiClient; +use ComplyCube\Resources\AccountInfoApi; +use ComplyCube\Resources\AddressApi; +use ComplyCube\Resources\AuditLogApi; +use ComplyCube\Resources\CheckApi; +use ComplyCube\Resources\ClientApi; +use ComplyCube\Resources\CompanyApi; +use ComplyCube\Resources\CustomListApi; +use ComplyCube\Resources\DocumentApi; +use ComplyCube\Resources\FlowSessionApi; +use ComplyCube\Resources\LivePhotoApi; +use ComplyCube\Resources\LiveVideoApi; +use ComplyCube\Resources\ReportApi; +use ComplyCube\Resources\RiskProfileApi; +use ComplyCube\Resources\TeamMemberApi; +use ComplyCube\Resources\TokenApi; +use ComplyCube\Resources\WebhookApi; class ComplyCubeClient { - public $apiClient; - private $clientApi; - private $addressApi; - private $checkApi; - private $documentApi; - private $livePhotoApi; - private $liveVideoApi; - private $riskProfileApi; - private $webhookApi; - private $tokenApi; - private $teamMemberApi; - private $auditLogApi; - private $accountInfo; - private $flowSessionApi; - + public ApiClient $apiClient; + private ?ClientApi $clientApi; + private ?AddressApi $addressApi; + private ?CheckApi $checkApi; + private ?DocumentApi $documentApi; + private ?LivePhotoApi $livePhotoApi; + private ?LiveVideoApi $liveVideoApi; + private ?ReportApi $reportApi; + private ?RiskProfileApi $riskProfileApi; + private ?WebhookApi $webhookApi; + private ?TokenApi $tokenApi; + private ?TeamMemberApi $teamMemberApi; + private ?AuditLogApi $auditLogApi; + private ?AccountInfoApi $accountInfoApi; + private ?FlowSessionApi $flowSessionApi; + private ?CompanyApi $companyApi; + private ?CustomListApi $customListApi; + /** * Create a ComplyCubeClient API Client Instance for the provided * API key. @@ -36,10 +55,10 @@ public function __construct(string $apiKey, $maxRetries = 0) * * @return ClientApi */ - public function clients() : \ComplyCube\Resources\ClientApi + public function clients(): ClientApi { if (empty($this->clientApi)) { - $this->clientApi = new \ComplyCube\Resources\ClientApi($this->apiClient); + $this->clientApi = new ClientApi($this->apiClient); } return $this->clientApi; } @@ -48,12 +67,12 @@ public function clients() : \ComplyCube\Resources\ClientApi * Address API allows you to create, retrieve, update, and delete your clients' addresses. * You can retrieve a specific address as well as a list of all your client's addresses. * - * @return \ComplyCube\Resources\AddressApi + * @return AddressApi */ - public function address(): \ComplyCube\Resources\AddressApi + public function address(): AddressApi { if (empty($this->addressApi)) { - $this->addressApi = new \ComplyCube\Resources\AddressApi($this->apiClient); + $this->addressApi = new AddressApi($this->apiClient); } return $this->addressApi; } @@ -62,12 +81,12 @@ public function address(): \ComplyCube\Resources\AddressApi * Checks API allows you to create, update, validate, and retrieve checks. * You can retrieve a specific check as well as a list all your client's checks. * - * @return ComplyCube\Resources\CheckApi + * @return CheckApi */ - public function checks() : \ComplyCube\Resources\CheckApi + public function checks(): CheckApi { if (empty($this->checkApi)) { - $this->checkApi = new \ComplyCube\Resources\CheckApi($this->apiClient); + $this->checkApi = new CheckApi($this->apiClient); } return $this->checkApi; } @@ -76,12 +95,12 @@ public function checks() : \ComplyCube\Resources\CheckApi * Documents API allows you to create, update, retrieve, upload, and delete documents. * You can retrieve a specific document as well as a list of all your client's documents. * - * @return \ComplyCube\Resources\DocumentApi + * @return DocumentApi */ - public function documents() : \ComplyCube\Resources\DocumentApi + public function documents(): DocumentApi { if (empty($this->documentApi)) { - $this->documentApi = new \ComplyCube\Resources\DocumentApi($this->apiClient); + $this->documentApi = new DocumentApi($this->apiClient); } return $this->documentApi; } @@ -90,12 +109,12 @@ public function documents() : \ComplyCube\Resources\DocumentApi * Live photos API allows you to upload, retrieve, download, and delete live photos. * You can retrieve a specific live photo as well as a list all your client's live photos. * - * @return \ComplyCube\Resources\LivePhotoApi + * @return LivePhotoApi */ - public function livephotos() : \ComplyCube\Resources\LivePhotoApi + public function livephotos(): LivePhotoApi { if (empty($this->livePhotoApi)) { - $this->livePhotoApi = new \ComplyCube\Resources\LivePhotoApi($this->apiClient); + $this->livePhotoApi = new LivePhotoApi($this->apiClient); } return $this->livePhotoApi; } @@ -104,12 +123,12 @@ public function livephotos() : \ComplyCube\Resources\LivePhotoApi * Live videos API allows you to upload, retrieve, download, and delete live photos. * You can retrieve a specific live photo as well as a list all your client's live photos. * - * @return \ComplyCube\Resources\LiveVideoApi + * @return LiveVideoApi */ - public function livevideos() : \ComplyCube\Resources\LiveVideoApi + public function livevideos(): LiveVideoApi { if (empty($this->liveVideoApi)) { - $this->liveVideoApi = new \ComplyCube\Resources\LiveVideoApi($this->apiClient); + $this->liveVideoApi = new LiveVideoApi($this->apiClient); } return $this->liveVideoApi; } @@ -118,12 +137,12 @@ public function livevideos() : \ComplyCube\Resources\LiveVideoApi * Report API allows you to create a PDF file extract for a given client or check. * The report represents a snapshot instance of the client or check at the time of generation. * - * @return \ComplyCube\Resources\ReportApi + * @return ReportApi */ - public function reports() : \ComplyCube\Resources\ReportApi + public function reports(): ReportApi { if (empty($this->reportApi)) { - $this->reportApi = new \ComplyCube\Resources\ReportApi($this->apiClient); + $this->reportApi = new ReportApi($this->apiClient); } return $this->reportApi; } @@ -133,26 +152,26 @@ public function reports() : \ComplyCube\Resources\ReportApi * It facilitates a risk-based framework for Client Due Diligence (CDD) and Enhanced Due Diligence (EDD). * Furthermore, the risk profile will assist you in shaping your ongoing client relationship. * - * @return \ComplyCube\Resources\RiskProfileApi + * @return RiskProfileApi */ - public function riskProfiles() : \ComplyCube\Resources\RiskProfileApi + public function riskProfiles(): RiskProfileApi { - if (empty($this->riskprofileApi)) { - $this->riskprofileApi = new \ComplyCube\Resources\RiskProfileApi($this->apiClient); + if (empty($this->riskProfileApi)) { + $this->riskProfileApi = new RiskProfileApi($this->apiClient); } - return $this->riskprofileApi; + return $this->riskProfileApi; } /** * Configure webhook endpoints via the API to be notified about events that happen in your * ComplyCube account and related resources. * - * @return \ComplyCube\Resources\WebhookApi + * @return WebhookApi */ - public function webhooks() : \ComplyCube\Resources\WebhookApi + public function webhooks(): WebhookApi { if (empty($this->webhookApi)) { - $this->webhookApi = new \ComplyCube\Resources\WebhookApi($this->apiClient); + $this->webhookApi = new WebhookApi($this->apiClient); } return $this->webhookApi; } @@ -162,12 +181,12 @@ public function webhooks() : \ComplyCube\Resources\WebhookApi * Each token is confined to one client and expire after 60 minutes, so you can safely use * them in the frontend of your application. * - * @return \ComplyCube\Resources\TokenApi + * @return TokenApi */ - public function tokens() : \ComplyCube\Resources\TokenApi + public function tokens(): TokenApi { if (empty($this->tokenApi)) { - $this->tokenApi = new \ComplyCube\Resources\TokenApi($this->apiClient); + $this->tokenApi = new TokenApi($this->apiClient); } return $this->tokenApi; } @@ -176,12 +195,12 @@ public function tokens() : \ComplyCube\Resources\TokenApi * Team member API provides information on your team members. * You can get, filter and list your team members through the API. * - * @return \ComplyCube\Resources\TeamMemberApi + * @return TeamMemberApi */ - public function teamMembers() : \ComplyCube\Resources\TeamMemberApi + public function teamMembers(): TeamMemberApi { if (empty($this->teamMemberApi)) { - $this->teamMemberApi = new \ComplyCube\Resources\TeamMemberApi($this->apiClient); + $this->teamMemberApi = new TeamMemberApi($this->apiClient); } return $this->teamMemberApi; } @@ -189,12 +208,12 @@ public function teamMembers() : \ComplyCube\Resources\TeamMemberApi /** * Audit Log API allows you to retrieve audit logs for a given client, action, resource, or trigger. * - * @return \ComplyCube\Resources\AuditLogApi + * @return AuditLogApi */ - public function auditLogs() : \ComplyCube\Resources\AuditLogApi + public function auditLogs(): AuditLogApi { if (empty($this->auditLogApi)) { - $this->auditLogApi = new \ComplyCube\Resources\AuditLogApi($this->apiClient); + $this->auditLogApi = new AuditLogApi($this->apiClient); } return $this->auditLogApi; } @@ -204,35 +223,74 @@ public function auditLogs() : \ComplyCube\Resources\AuditLogApi * * @return iterable */ - public function screeningLists() : iterable + public function screeningLists(): iterable { - $response = $this->apiClient->get('static/screeningLists'); - return json_decode($response->getBody()); + $response = $this->apiClient->get("static/screeningLists"); + return json_decode($response->getBody(), true); + } + + /** + * Allows you to retrieve a list of all documents supported by our Document Checks service. + * + * @return iterable + */ + public function supportedDocuments(): iterable + { + $response = $this->apiClient->get("static/supportedDocuments"); + return json_decode($response->getBody(), true); } /** * Account Info API allows you to get account info around usage and credits. * - * @return \ComplyCube\Resources\AccountInfoApi + * @return AccountInfoApi */ - public function accountInfo() : \ComplyCube\Resources\AccountInfoApi + public function accountInfo(): AccountInfoApi { if (empty($this->accountInfoApi)) { - $this->accountInfoApi = new \ComplyCube\Resources\AccountInfoApi($this->apiClient); + $this->accountInfoApi = new AccountInfoApi($this->apiClient); } return $this->accountInfoApi; } /** - * Flow API lets you create a unique ComplyCube URL address to redirect your clients + * Flow API lets you create a unique ComplyCube URL address to redirect your clients * - * @return \ComplyCube\Resources\FlowSessionApi + * @return FlowSessionApi */ - public function flow() : \ComplyCube\Resources\FlowSessionApi + public function flow(): FlowSessionApi { if (empty($this->flowSessionApi)) { - $this->flowSessionApi = new \ComplyCube\Resources\FlowSessionApi($this->apiClient); + $this->flowSessionApi = new FlowSessionApi($this->apiClient); } return $this->flowSessionApi; } + + /** + * Company API allows you to retrieve and search for companies details. + * You can retrieve a specific company's details as well as a list of all of your companies'. + * + * @return CompanyApi + */ + public function companies(): CompanyApi + { + if (empty($this->companyApi)) { + $this->companyApi = new CompanyApi($this->apiClient); + } + return $this->companyApi; + } + + /** + * Company API allows you to retrieve, list and update your custom lists. + * You can retrieve a specific custom list's details as well as a list of all of your custom lists'. + * + * @return CustomListApi + */ + public function customLists(): CustomListApi + { + if (empty($this->customListApi)) { + $this->customListApi = new CustomListApi($this->apiClient); + } + return $this->customListApi; + } } diff --git a/lib/EventVerifier.php b/lib/EventVerifier.php index 66fa294..ee89561 100644 --- a/lib/EventVerifier.php +++ b/lib/EventVerifier.php @@ -2,11 +2,14 @@ namespace ComplyCube; +use ComplyCube\Exception\VerificationException; +use ComplyCube\Model\Event; + class EventVerifier { - private $secret; + private string $secret; - public function __construct($secret) + public function __construct(string $secret) { $this->secret = $secret; } @@ -16,15 +19,15 @@ public function __construct($secret) * * @param string $responseBody the received event * @param string $expectedHash the received event signature - * @return void + * @return Event */ public function constructEvent(string $responseBody, string $expectedHash) { $calculatedHash = hash_hmac("sha256", $responseBody, $this->secret); if (!hash_equals($calculatedHash, $expectedHash)) { - throw new \ComplyCube\Exception\VerificationException('Invalid signature for event'); + throw new VerificationException("Invalid signature for event"); } - $event = new \ComplyCube\Model\Event(); + $event = new Event(); $event->load(json_decode($responseBody)); return $event; } diff --git a/lib/Model/AccountInfo.php b/lib/Model/AccountInfo.php index 7086b63..d4b115c 100644 --- a/lib/Model/AccountInfo.php +++ b/lib/Model/AccountInfo.php @@ -2,27 +2,9 @@ namespace ComplyCube\Model; -class AccountInfo implements \JsonSerializable +class AccountInfo extends Model { - public string $username; - public string $plan; - public ?string $remainingCredit = null; - - public function load(\stdClass $response) - { - $this->username = $response->username; - $this->plan = $response->plan; - $this->remainingCredit = isset($response->remainingCredit) ? $response->remainingCredit : null; - } - - public function jsonSerialize() - { - return array_filter([ - 'username' => $this->username, - 'plan' => $this->plan, - 'remainingCredit' => $this->remainingCredit - ], function ($value) { - return ($value !== null); - }); - } + public ?string $username; + public ?string $plan; + public ?int $remainingCredit; } diff --git a/lib/Model/Address.php b/lib/Model/Address.php index 904fa40..71555b7 100644 --- a/lib/Model/Address.php +++ b/lib/Model/Address.php @@ -2,62 +2,22 @@ namespace ComplyCube\Model; -use \stdClass; +use Carbon\Carbon; -class Address implements \JsonSerializable +class Address extends Model { - public $id; - public $clientId; - public $type; - public $propertyNumber; - public $buildingName; - public $line; - public $city; - public $state; - public $postalCode; - public $country; - public $fromDate; - public $toDate; - protected $lastActionBy; - protected $createdAt; - protected $updatedAt; - - public function load(stdClass $response) - { - $this->id = $response->id; - $this->clientId = $response->clientId; - $this->type = isset($response->type) ? $response->type : null; - $this->propertyNumber = isset($response->propertyNumber) ? $response->propertyNumber : null; - $this->buildingName = isset($response->buildingName) ? $response->buildingName : null; - $this->line = $response->line; - $this->city = $response->city; - $this->state = isset($response->state) ? $response->state : null; - $this->postalCode = isset($response->postalCode) ? $response->postalCode : null; - $this->country = $response->country; - $this->fromDate = isset($response->fromDate) ? $response->fromDate : null; - $this->toDate = isset($response->toDate) ? $response->toDate : null; - $this->lastActionBy = isset($response->lastActionBy) ? $response->lastActionBy : null; - $this->createdAt = isset($response->createdAt) ? $response->createdAt : null; - $this->updatedAt = isset($response->updatedAt) ? $response->updatedAt : null; - } - - public function jsonSerialize() - { - return array_filter([ - 'id' => $this->id, - 'clientId' => $this->clientId, - 'type' => $this->type, - 'propertyNumber' => $this->propertyNumber, - 'buildingName' => $this->buildingName, - 'line' => $this->line, - 'city' => $this->city, - 'state' => $this->state, - 'postalCode' => $this->postalCode, - 'country' => $this->country, - 'fromDate' => $this->fromDate, - 'toDate' => $this->toDate - ], function ($value) { - return ($value !== null); - }); - } + public ?string $id; + public ?string $clientId; + public ?string $type; + public ?string $propertyNumber; + public ?string $buildingName; + public ?string $line; + public ?string $city; + public ?string $state; + public ?string $postalCode; + public ?string $country; + public ?string $fromDate; + public ?string $toDate; + protected ?Carbon $createdAt; + protected ?Carbon $updatedAt; } diff --git a/lib/Model/AuditDiff.php b/lib/Model/AuditDiff.php index 26e7f42..77e604d 100644 --- a/lib/Model/AuditDiff.php +++ b/lib/Model/AuditDiff.php @@ -2,30 +2,23 @@ namespace ComplyCube\Model; -class AuditDiff implements \JsonSerializable +use stdClass; + +class AuditDiff extends Model { public ?string $action; - public $path = []; - public $old; + public ?array $path; + public ?string $old; public $new; - public function __construct($aDiff) + public function load(stdClass $response): void { - $this->action = $aDiff->action; - $this->path = $aDiff->path; - $this->old = isset($aDiff->old) ? $aDiff->old : null; - $this->new = isset($aDiff->new) ? $aDiff->new : null; - } + parent::load($response); - public function jsonSerialize() - { - return array_filter([ - 'action' => $this->action, - 'path' => $this->path, - 'old' => $this->old, - 'new' => $this->new - ], function ($value) { - return ($value !== null); - }); + $this->path = property_exists($response, "path") + ? $response->path + : null; + + $this->new = property_exists($response, "new") ? $response->new : null; } } diff --git a/lib/Model/AuditLog.php b/lib/Model/AuditLog.php index 9c50342..89f302d 100644 --- a/lib/Model/AuditLog.php +++ b/lib/Model/AuditLog.php @@ -2,46 +2,31 @@ namespace ComplyCube\Model; -class AuditLog implements \JsonSerializable +use Carbon\Carbon; +use stdClass; + +class AuditLog extends Model { - public ?string $id = null; - public ?string $member = null; - public ?string $resourceType = null; - public ?string $clientId = null; - public ?string $trigger = null; - public ?string $action = null; - public $createdAt = null; - public $diff = array(); + public ?string $id; + public ?string $memberId; + public ?string $resourceType; + public ?string $resourceId; + public ?string $clientId; + public ?string $trigger; + public ?string $action; + public ?array $diff; + public ?Carbon $createdAt; - public function load(\stdClass $response) + public function load(stdClass $response): void { - $this->id = $response->id; - $this->member = isset($response->member) ? $response->member : null; - $this->resourceType = $response->resourceType; - $this->clientId = $response->clientId; - $this->trigger = $response->trigger; - $this->action = $response->action; - $this->createdAt = new \DateTime($response->createdAt); + parent::load($response); + if (isset($response->diff)) { foreach ($response->diff as $aDiff) { - $diff[] = new AuditDiff($aDiff); + $this->diff[] = new AuditDiff($aDiff); } + } else { + $this->diff = null; } } - - public function jsonSerialize() - { - return array_filter([ - 'id' => $this->id, - 'member' => $this->member, - 'resourceType' => $this->resourceType, - 'clientId' => $this->clientId, - 'trigger' => $this->trigger, - 'action' => $this->action, - 'createdAt' => $this->createdAt, - - ], function ($value) { - return ($value !== null); - }); - } } diff --git a/lib/Model/Challenge.php b/lib/Model/Challenge.php new file mode 100644 index 0000000..49719a8 --- /dev/null +++ b/lib/Model/Challenge.php @@ -0,0 +1,20 @@ +value = property_exists($response, "value") + ? $response->value + : null; + } +} diff --git a/lib/Model/Check.php b/lib/Model/Check.php index c3ca662..7c731de 100644 --- a/lib/Model/Check.php +++ b/lib/Model/Check.php @@ -2,61 +2,37 @@ namespace ComplyCube\Model; -use \stdClass; +use Carbon\Carbon; +use stdClass; -class Check implements \JsonSerializable +class Check extends Model { - public ?string $id = null; - public ?string $clientId = null; - public ?bool $enableMonitoring = false; - public ?string $documentId = null; - public ?string $addressId = null; - public ?string $livePhotoId = null; - public ?string $liveVideoId = null; - public ?string $entityName = null; - public ?string $type = null; - public ?CheckOptions $options = null; - public ?string $status = null; + public ?string $id; + public ?string $clientId; + public ?bool $enableMonitoring; + public ?string $documentId; + public ?string $addressId; + public ?string $livePhotoId; + public ?string $liveVideoId; + public ?string $entityName; + public ?string $type; + public ?CheckOptions $options; + public ?bool $clientConsent; + public ?string $status; public $result; - protected $createdAt; - protected $updatedAt; + protected ?Carbon $createdAt; + protected ?Carbon $updatedAt; - public function load(stdClass $response) + public function load(stdClass $response): void { - $this->id = $response->id; - $this->clientId = $response->clientId; - $this->enableMonitoring = isset($response->enableMonitoring) ? $response->enableMonitoring : null; - $this->documentId = isset($response->documentId) ? $response->documentId : null; - $this->addressId = isset($response->addressId) ? $response->addressId : null; - $this->livePhotoId = isset($response->livePhotoId) ? $response->livePhotoId : null; - $this->liveVideoId = isset($response->liveVideoId) ? $response->liveVideoId : null; - $this->entityName = $response->entityName; - $this->type = $response->type; - $this->status = isset($response->status) ? $response->status : null; - $this->result = isset($response->result) ? $response->result : null; - $this->createdAt = isset($response->createdAt) ? $response->createdAt : null; - $this->updatedAt = isset($response->updatedAt) ? $response->updatedAt : null; - } + parent::load($response); - public function jsonSerialize() - { - return array_filter([ - 'id' => $this->id, - 'clientId' => $this->clientId, - 'enableMonitoring' => $this->enableMonitoring, - 'documentId' => $this->documentId, - 'addressId' => $this->addressId, - 'livePhotoId' => $this->livePhotoId, - 'liveVideoId' => $this->liveVideoId, - 'entityName' => $this->entityName, - 'options' => $this->options, - 'type' => $this->type, - 'status' => $this->status, - 'result' => $this->result, - 'createdAt' => $this->createdAt, - 'updatedAt' => $this->updatedAt - ], function ($value) { - return ($value !== null); - }); + $this->options = property_exists($response, "options") + ? new CheckOptions($response->options) + : null; + + $this->result = property_exists($response, "result") + ? $response->result + : null; } } diff --git a/lib/Model/CheckOptions.php b/lib/Model/CheckOptions.php index 43b4a07..6362871 100644 --- a/lib/Model/CheckOptions.php +++ b/lib/Model/CheckOptions.php @@ -2,25 +2,24 @@ namespace ComplyCube\Model; -use \stdClass; +use stdClass; -class ScreeningListsScope implements \JsonSerializable +class ScreeningListsScope extends Model { - public string $mode; - public iterable $lists; + public ?string $mode; + public ?iterable $lists; - public function jsonSerialize() + public function load(stdClass $response): void { - return array_filter([ - 'mode' => $this->mode, - 'lists' => $this->lists - ], function ($value) { - return ($value !== null); - }); + parent::load($response); + + $this->lists = property_exists($response, "lists") + ? $response->lists + : null; } } -class CheckOptions implements \JsonSerializable +class CheckOptions extends Model { public ?ScreeningListsScope $screeningListsScope; public ?string $screeningNameSearchMode; @@ -29,17 +28,24 @@ class CheckOptions implements \JsonSerializable public ?int $minimumPermittedAge; public ?bool $clientDataValidation; - public function jsonSerialize() + public function load(stdClass $response): void { - return array_filter([ - 'screeningListsScope' => $this->screeningListsScope, - 'screeningNameSearchMode' => $this->screeningNameSearchMode, - 'screeningClassification' => $this->screeningClassification, - 'analysisCoverage' => $this->analysisCoverage, - 'minimumPermittedAge' => $this->minimumPermittedAge, - 'clientDataValidation' => $this->clientDataValidation - ], function ($value) { - return ($value !== null); - }); + $this->screeningListsScope = property_exists( + $response, + "screeningListsScope" + ) + ? new ScreeningListsScope($response->screeningListsScope) + : null; + + $this->screeningClassification = property_exists( + $response, + "screeningClassification" + ) + ? $response->screeningClassification + : null; + + $this->analysisCoverage = property_exists($response, "analysisCoverage") + ? $response->analysisCoverage + : null; } -} \ No newline at end of file +} diff --git a/lib/Model/Client.php b/lib/Model/Client.php index 7a1419f..855872a 100644 --- a/lib/Model/Client.php +++ b/lib/Model/Client.php @@ -2,63 +2,43 @@ namespace ComplyCube\Model; -use \stdClass; +use Carbon\Carbon; +use stdClass; -class Client implements \JsonSerializable +class Client extends Model { - public $id; - public $type; - public $entityName; - public $email; - public $mobile; - public $telephone; - public $joinedDate; - public $personDetails; - public $companyDetails; - protected $lastActionBy; - protected $createdAt; - protected $updatedAt; + public ?string $id; + public ?string $type; + public ?string $entityName; + public ?string $email; + public ?string $mobile; + public ?string $telephone; + public ?string $externalId; + public ?string $joinedDate; + public ?PersonDetails $personDetails; + public ?CompanyDetails $companyDetails; + public $metadata; + protected ?Carbon $createdAt; + protected ?Carbon $updatedAt; - public function load(stdClass $response) + public function load(stdClass $response): void { - $this->id = $response->id; - $this->type = $response->type; - $this->entityName = isset($response->entityName) ? $response->entityName : null; - $this->email = $response->email; - $this->mobile = isset($response->mobile) ? $response->mobile : null; - $this->telephone = isset($response->telephone) ? $response->telephone : null; - if (isset($response->personDetails)) { - $pd = new PersonDetails(); - $pd->load($response->personDetails); - $this->personDetails = $pd; + parent::load($response); + + if (property_exists($response, "personDetails")) { + $this->personDetails = new PersonDetails($response->personDetails); $this->companyDetails = null; } - if (isset($response->companyDetails)) { - $cd = new CompanyDetails(); - $cd->load($response->companyDetails); - $this->companyDetails = $cd; + + if (property_exists($response, "companyDetails")) { + $this->companyDetails = new CompanyDetails( + $response->companyDetails + ); $this->personDetails = null; } - $this->lastActionBy = isset($response->lastActionBy) ? $response->lastActionBy : null; - $this->createdAt = isset($response->createdAt) ? $response->createdAt : null; - $this->updatedAt = isset($response->updatedAt) ? $response->updatedAt : null; - } - public function jsonSerialize() - { - return array_filter([ - 'id' => $this->id, - 'type' => $this->type, - 'entityName' => $this->entityName, - 'email' => $this->email, - 'mobile' => $this->mobile, - 'telephone' => $this->telephone, - 'personDetails' => $this->personDetails, - 'companyDetails' => $this->companyDetails, - 'createdAt' => $this->createdAt, - 'updatedAt' => $this->updatedAt - ], function ($value) { - return ($value !== null); - }); + $this->metadata = property_exists($response, "metadata") + ? $response->metadata + : null; } } diff --git a/lib/Model/CompanyDetails.php b/lib/Model/CompanyDetails.php index 55ad17a..9f9194b 100644 --- a/lib/Model/CompanyDetails.php +++ b/lib/Model/CompanyDetails.php @@ -2,35 +2,50 @@ namespace ComplyCube\Model; -use \stdClass; +use Carbon\Carbon; +use stdClass; -class CompanyDetails implements \JsonSerializable +class CompanyDetails extends Model { - public $name; - public $website; - public $registrationNumber; - public $incorporationCountry; - public $incorporationType; + public ?string $id; + public ?string $name; + public ?string $registrationNumber; + public ?string $incorporationCountry; + public ?string $incorporationDate; + public ?string $incorporationType; + public ?Address $address; + public ?bool $active; + public ?string $sourceUrl; + public ?array $owners; + public ?array $officers; + public ?array $filings; + public ?array $industryCodes; + public ?string $website; + protected ?Carbon $createdAt; + protected ?Carbon $updatedAt; - public function load(stdClass $response) + public function load(stdClass $response): void { - $this->name = $response->name; - $this->website = isset($response->website) ? $response->website : null; - $this->registrationNumber = isset($response->registrationNumber) ? $response->registrationNumber : null; - $this->incorporationCountry = isset($response->incorporationCountry) ? $response->incorporationCountry : null; - $this->incorporationType = isset($response->incorporationType) ? $response->incorporationType : null; - } + parent::load($response); - public function jsonSerialize() - { - return array_filter([ - 'name' => $this->name, - 'website' => $this->website, - 'registrationNumber' => $this->registrationNumber, - 'incorporationCountry' => $this->incorporationCountry, - 'incorporationType' => $this->incorporationType - ], function ($value) { - return ($value !== null); - }); + $this->address = property_exists($response, "address") + ? new Address($response->address) + : null; + + $this->owners = property_exists($response, "owners") + ? $response->owners + : null; + + $this->officers = property_exists($response, "officers") + ? $response->officers + : null; + + $this->filings = property_exists($response, "filings") + ? $response->filings + : null; + + $this->industryCodes = property_exists($response, "industryCodes") + ? $response->industryCodes + : null; } } diff --git a/lib/Model/ComplyCubeCollection.php b/lib/Model/ComplyCubeCollection.php index 8d7f239..0aac777 100644 --- a/lib/Model/ComplyCubeCollection.php +++ b/lib/Model/ComplyCubeCollection.php @@ -2,29 +2,63 @@ namespace ComplyCube\Model; -use ComplyCube\ComplyCubeClient; +use Iterator; +use stdClass; -class ComplyCubeCollection implements \Iterator +class ComplyCubeCollection extends Model implements Iterator { - public $page; - public $items = []; - public $pages; - public $pageSize; - public $totalSize; - private $position = 0; - - public function __construct(string $model, \stdClass $apiResponse) - { - $this->page = $apiResponse->page; - if (property_exists($apiResponse, 'items')) { - $this->items = $apiResponse->items; + public int $page; + public int $pageSize; + public int $totalItems; + public int $pages; + public ?array $items; + private int $position; + private string $model; + + public function __construct(string $model, stdClass $apiResponse) + { + $this->model = $model; + + $this->load($apiResponse); + } + + public function load(stdClass $response): void + { + $this->page = property_exists($response, "page") ? $response->page : 1; + + $this->pageSize = property_exists($response, "pageSize") + ? $response->pageSize + : 100; + + $this->totalItems = property_exists($response, "totalItems") + ? $response->totalItems + : 0; + + $this->pages = property_exists($response, "pages") + ? $response->pages + : 0; + + if (property_exists($response, "items")) { + foreach ($response->items as $item) { + $this->items[] = new $this->model($item); + } + } else { + $this->items = null; } - $this->pages = $apiResponse->pages; - $this->pageSize = $apiResponse->pageSize; - $this->totalItems = $apiResponse->totalItems; + + $this->rewind(); + } + + public function jsonSerialize() + { + return array_filter( + parent::jsonSerialize(), + fn($key) => !in_array($key, ["position", "model"]), + ARRAY_FILTER_USE_KEY + ); } - public function rewind() + public function rewind(): void { $this->position = 0; } @@ -39,12 +73,12 @@ public function key() return $this->position; } - public function next() + public function next(): void { ++$this->position; } - public function valid() + public function valid(): bool { return isset($this->items[$this->position]); } diff --git a/lib/Model/CustomList.php b/lib/Model/CustomList.php new file mode 100644 index 0000000..1cc41f1 --- /dev/null +++ b/lib/Model/CustomList.php @@ -0,0 +1,26 @@ +stats = property_exists($response, "stats") + ? new CustomListStats($response->stats) + : null; + } +} diff --git a/lib/Model/CustomListStats.php b/lib/Model/CustomListStats.php new file mode 100644 index 0000000..bf5333d --- /dev/null +++ b/lib/Model/CustomListStats.php @@ -0,0 +1,9 @@ +id = $response->id; - $this->clientId = $response->clientId; - $this->type = $response->type; - $this->classification = isset($response->classification) ? $response->classification : null; - $this->issuingCountry = isset($response->issuingCountry) ? $response->issuingCountry : null; - $this->createdAt = isset($response->createdAt) ? $response->createdAt : null; - $this->updatedAt = isset($response->updatedAt) ? $response->updatedAt : null; - } + parent::load($response); - public function jsonSerialize() - { - return array_filter([ - 'id' => $this->id, - 'clientId' => $this->clientId, - 'type' => $this->type, - 'classification' => $this->classification, - 'issuingCountry' => $this->issuingCountry, - 'createdAt' => $this->createdAt, - 'updatedAt' => $this->updatedAt - ], function ($value) { - return ($value !== null); - }); + if (property_exists($response, "images")) { + foreach ($response->images as $image) { + $this->images[] = new Image($image); + } + } else { + $this->images = null; + } } } diff --git a/lib/Model/Event.php b/lib/Model/Event.php index 13b1a15..1114b42 100644 --- a/lib/Model/Event.php +++ b/lib/Model/Event.php @@ -2,33 +2,23 @@ namespace ComplyCube\Model; -class Event implements \JsonSerializable +use Carbon\Carbon; +use stdClass; + +class Event extends Model { - public $id; - public $type; - public $resourceType; + public ?string $id; + public ?string $type; + public ?string $resourceType; public $payload; - public $createdAt; + protected ?Carbon $createdAt; - public function load(\stdClass $response) + public function load(stdClass $response): void { - $this->id = $response->id; - $this->type = isset($response->type) ? $response->type : null; - $this->resourceType = isset($response->resourceType) ? $response->resourceType : null; - $this->payload = isset($response->payload) ? $response->payload : null; - $this->createdAt = isset($response->createdAt) ? $response->createdAt : null; - } + parent::load($response); - public function jsonSerialize() - { - return array_filter([ - 'id' => $this->id, - 'type' => $this->type, - 'resourceType' => $this->resourceType, - 'payload' => $this->payload, - 'createdAt' => $this->createdAt - ], function ($value) { - return ($value !== null); - }); + $this->payload = property_exists($response, "payload") + ? $response->payload + : null; } } diff --git a/lib/Model/FlowSession.php b/lib/Model/FlowSession.php index 5dae2ab..da5a442 100644 --- a/lib/Model/FlowSession.php +++ b/lib/Model/FlowSession.php @@ -2,44 +2,25 @@ namespace ComplyCube\Model; -use \stdClass; +use stdClass; -class FlowSession implements \JsonSerializable +class FlowSession extends Model { - public ?string $clientId = null; - public $checkTypes = null; - public ?string $successUrl = null; - public ?string $cancelUrl = null; - public ?string $theme = null; - public ?string $language = null; - public ?bool $enableMonitoring = null; - public ?string $redirectUrl = null; + public ?string $clientId; + public ?array $checkTypes; + public ?string $successUrl; + public ?string $cancelUrl; + public ?bool $enableMonitoring; + public ?string $language; + public ?string $theme; + public ?string $redirectUrl; - public function load(stdClass $response) + public function load(stdClass $response): void { - $this->clientId = isset($response->clientId) ? $response->clientId : null; - $this->checkTypes = isset($response->checkTypes) ? $response->checkTypes : null; - $this->successUrl = isset($response->successUrl) ? $response->successUrl : null; - $this->cancelUrl = isset($response->cancelUrl) ? $response->cancelUrl : null; - $this->theme = isset($response->theme) ? $response->theme : null; - $this->language = isset($response->language) ? $response->language : null; - $this->enableMonitoring = isset($response->enableMonitoring) ? $response->enableMonitoring : null; - $this->redirectUrl = isset($response->redirectUrl) ? $response->redirectUrl : null; - } + parent::load($response); - public function jsonSerialize() - { - return array_filter([ - 'clientId' => $this->clientId, - 'checkTypes' => $this->checkTypes, - 'successUrl' => $this->successUrl, - 'cancelUrl' => $this->cancelUrl, - 'theme' => $this->theme, - 'language' => $this->language, - 'enableMonitoring' => $this->enableMonitoring, - 'redirectUrl' => $this->redirectUrl - ], function ($value) { - return ($value !== null); - }); + $this->checkTypes = property_exists($response, "checkTypes") + ? $response->checkTypes + : null; } } diff --git a/lib/Model/Image.php b/lib/Model/Image.php index e056e68..3df2b11 100644 --- a/lib/Model/Image.php +++ b/lib/Model/Image.php @@ -2,53 +2,19 @@ namespace ComplyCube\Model; -use \stdClass; +use Carbon\Carbon; -class Image implements \JsonSerializable +class Image extends Model { - public ?string $id = null; - public ?string $clientId = null; - public ?string $fileName = null; - public ?bool $performLivenessCheck = null; - public ?string $documentSide = null; - public ?string $downloadLink = null; - public ?string $contentType = null; - public ?string $data = null; - public ?int $size = null; - protected $createdAt; - protected $updatedAt; - - public function load(stdClass $response) - { - $this->id = isset($response->id) ? $response->id : null; - $this->clientId = isset($response->clientId) ? $response->clientId : null; - $this->fileName = isset($response->fileName) ? $response->fileName : null; - $this->performLivenessCheck = isset($response->performLivenessCheck) ? $response->performLivenessCheck : null; - $this->documentSide = isset($response->documentSide) ? $response->documentSide : null; - $this->downloadLink = isset($response->downloadLink) ? $response->downloadLink : null; - $this->contentType = $response->contentType; - $this->size = isset($response->size) ? $response->size : null; - $this->data = isset($response->data) ? $response->data : null; - $this->createdAt = isset($response->createdAt) ? $response->createdAt : null; - $this->updatedAt = isset($response->updatedAt) ? $response->updatedAt : null; - } - - public function jsonSerialize() - { - return array_filter([ - 'id' => $this->id, - 'clientId' => $this->clientId, - 'fileName' => $this->fileName, - 'performLivenessCheck' => $this->performLivenessCheck, - 'documentSide' => $this->documentSide, - 'downloadLink' => $this->downloadLink, - 'contentType' => $this->contentType, - 'data' => $this->data, - 'size' => $this->size, - 'createdAt' => $this->createdAt, - 'updatedAt' => $this->updatedAt - ], function ($value) { - return ($value !== null); - }); - } + public ?string $id; + public ?string $clientId; + public ?string $fileName; + public ?bool $performLivenessCheck; + public ?string $documentSide; + public ?string $downloadLink; + public ?string $contentType; + public ?string $data; + public ?int $size; + protected ?Carbon $createdAt; + protected ?Carbon $updatedAt; } diff --git a/lib/Model/LiveVideo.php b/lib/Model/LiveVideo.php index 5311de6..ee96b2a 100644 --- a/lib/Model/LiveVideo.php +++ b/lib/Model/LiveVideo.php @@ -2,38 +2,28 @@ namespace ComplyCube\Model; -use \stdClass; +use Carbon\Carbon; +use stdClass; -class LiveVideo implements \JsonSerializable +class LiveVideo extends Model { - public ?string $id = null; - public ?string $clientId = null; - public ?string $language = null; - public $challenges = []; - protected $createdAt; - protected $updatedAt; + public ?string $id; + public ?string $clientId; + public ?string $language; + public ?array $challenges; + protected ?Carbon $createdAt; + protected ?Carbon $updatedAt; - public function load(stdClass $response) + public function load(stdClass $response): void { - $this->id = isset($response->id) ? $response->id : null; - $this->clientId = isset($response->clientId) ? $response->clientId : null; - $this->language = isset($response->language) ? $response->language : null; - $this->challenges = isset($response->challenges) ? $response->challenges : null; - $this->createdAt = isset($response->createdAt) ? $response->createdAt : null; - $this->updatedAt = isset($response->updatedAt) ? $response->updatedAt : null; - } + parent::load($response); - public function jsonSerialize() - { - return array_filter([ - 'id' => $this->id, - 'clientId' => $this->clientId, - 'language' => $this->language, - 'challenges' => $this->challenges, - 'createdAt' => $this->createdAt, - 'updatedAt' => $this->updatedAt - ], function ($value) { - return ($value !== null); - }); + if (property_exists($response, "challenges")) { + foreach ($response->challenges as $challenge) { + $this->challenges[] = new Challenge($challenge); + } + } else { + $this->challenges = null; + } } } diff --git a/lib/Model/Model.php b/lib/Model/Model.php new file mode 100644 index 0000000..59c29a1 --- /dev/null +++ b/lib/Model/Model.php @@ -0,0 +1,85 @@ +getProperties() + as $property + ) { + $property->setAccessible(true); + if (!$property->isInitialized($this)) { + $property->setValue($this, null); + } + } + } else { + $this->load((object) $data); + } + } + + public function load(stdClass $response): void + { + foreach ((new ReflectionObject($this))->getProperties() as $property) { + if (!property_exists($response, $property->name)) { + $this->{$property->name} = null; + } else { + $property_type = !is_null($property->getType()) + ? $property->getType()->getName() + : null; + + if ($property_type) { + if ( + in_array($property_type, [ + "bool", + "int", + "float", + "string", + ]) + ) { + $this->{$property->name} = $response->{$property->name}; + } elseif ($property_type == "Carbon\Carbon") { + switch (gettype($response->{$property->name})) { + case Carbon::class: + $this->{$property->name} = + $response->{$property->name}; + break; + + case "string": + $this->{$property->name} = Carbon::parse( + $response->{$property->name} + ); + break; + + default: + $this->{$property->name} = null; + break; + } + } + } + } + } + } + + public function jsonSerialize() + { + return array_filter( + array_map(function ($value) { + return $value instanceof Carbon + ? $value->toIso8601ZuluString() + : $value; + }, get_object_vars($this)), + function ($value) { + return $value !== null; + } + ); + } +} diff --git a/lib/Model/PersonDetails.php b/lib/Model/PersonDetails.php index 397517b..830322e 100644 --- a/lib/Model/PersonDetails.php +++ b/lib/Model/PersonDetails.php @@ -2,51 +2,17 @@ namespace ComplyCube\Model; -use \stdClass; - -class PersonDetails implements \JsonSerializable +class PersonDetails extends Model { - public $firstName; - public $lastName; - public $dob; - public $gender; - public $nationality; - public $birthCountry; - public $ssn; - public $socialInsuranceNumber; - public $nationalIdentityNumber; - public $taxIdentificationNumber; - - - public function load(stdClass $response) - { - $this->firstName = $response->firstName; - $this->lastName = $response->lastName; - $this->dob = isset($response->dob) ? $response->dob : null; - $this->gender = isset($response->gender) ? $response->gender : null; - $this->nationality = isset($response->nationality) ? $response->nationality : null; - $this->birthCountry = isset($response->birthCountry) ? $response->birthCountry : null; - $this->ssn = isset($response->ssn) ? $response->ssn : null; - $this->socialInsuranceNumber = isset($response->socialInsuranceNumber) ? $response->socialInsuranceNumber : null; - $this->nationalIdentityNumber = isset($response->nationalIdentityNumber) ? $response->nationalIdentityNumber : null; - $this->taxIdentificationNumber = isset($response->taxIdentificationNumber) ? $response->taxIdentificationNumber : null; - } - - public function jsonSerialize() - { - return array_filter([ - 'firstName' => $this->firstName, - 'lastName' => $this->lastName, - 'dob' => $this->dob, - 'gender' => $this->gender, - 'nationality' => $this->nationality, - 'birthCountry' => $this->birthCountry, - 'ssn' => $this->ssn, - 'socialInsuranceNumber' => $this->socialInsuranceNumber, - 'nationalIdentityNumber' => $this->nationalIdentityNumber, - 'taxIdentificationNumber' => $this->taxIdentificationNumber, - ], function ($value) { - return ($value !== null); - }); - } + public ?string $firstName; + public ?string $middleName; + public ?string $lastName; + public ?string $dob; + public ?string $gender; + public ?string $nationality; + public ?string $birthCountry; + public ?string $ssn; + public ?string $socialInsuranceNumber; + public ?string $nationalIdentityNumber; + public ?string $taxIdentificationNumber; } diff --git a/lib/Model/Report.php b/lib/Model/Report.php index 62b197a..16adf9c 100644 --- a/lib/Model/Report.php +++ b/lib/Model/Report.php @@ -2,26 +2,8 @@ namespace ComplyCube\Model; -use \stdClass; - -class Report implements \JsonSerializable +class Report extends Model { - public ?string $contentType = null; - public ?string $data = null; - - public function load(stdClass $response) - { - $this->contentType = $response->contentType; - $this->data = $response->data; - } - - public function jsonSerialize() - { - return array_filter([ - 'contentType' => $this->contentType, - 'data' => $this->data - ], function ($value) { - return ($value !== null); - }); - } + public ?string $contentType; + public ?string $data; } diff --git a/lib/Model/RiskProfile.php b/lib/Model/RiskProfile.php index bfb6746..0678406 100644 --- a/lib/Model/RiskProfile.php +++ b/lib/Model/RiskProfile.php @@ -2,126 +2,75 @@ namespace ComplyCube\Model; -use \stdClass; +use Carbon\Carbon; +use stdClass; -class RiskProfile implements \JsonSerializable +class RiskProfile extends Model { - public ?string $overall = null; - public ?CountryRisk $countryRisk = null; - public ?PoliticalExposureRisk $politicalExposureRisk = null; - public ?OccupationRisk $occupationRisk = null; - public ?WatchlistRisk $watchlistRisk = null; - - public function load(stdClass $response) - { - $this->overall = $response->overall; - $this->countryRisk = new CountryRisk($response->countryRisk); - $this->politicalExposureRisk = new PoliticalExposureRisk($response->politicalExposureRisk); - $this->occupationRisk = new OccupationRisk($response->occupationRisk); - $this->watchlistRisk = new WatchlistRisk($response->watchlistRisk); - } - - public function jsonSerialize() + public ?string $overall; + public ?CountryRisk $countryRisk; + public ?PoliticalExposureRisk $politicalExposureRisk; + public ?OccupationRisk $occupationRisk; + public ?WatchlistRisk $watchlistRisk; + public ?Carbon $updatedAt; + + public function load(stdClass $response): void { - return array_filter([ - 'overall' => $this->overall, - 'countryRisk' => $this->countryRisk, - 'politicalExposureRisk' => $this->politicalExposureRisk, - 'occupationRisk' => $this->occupationRisk, - 'watchlistRisk' => $this->watchlistRisk, - ], function ($value) { - return ($value !== null); - }); + parent::load($response); + + $this->countryRisk = property_exists($response, "countryRisk") + ? new CountryRisk($response->countryRisk) + : null; + + $this->politicalExposureRisk = property_exists( + $response, + "politicalExposureRisk" + ) + ? new PoliticalExposureRisk($response->politicalExposureRisk) + : null; + + $this->occupationRisk = property_exists($response, "occupationRisk") + ? new OccupationRisk($response->occupationRisk) + : null; + + $this->watchlistRisk = property_exists($response, "watchlistRisk") + ? new WatchlistRisk($response->watchlistRisk) + : null; } } -class CountryRisk implements \JsonSerializable +class CountryRisk extends Model { - public ?string $risk = null; - public ?string $country = null; - public $breakdown = null; + public ?string $risk; + public ?string $country; + public ?array $breakdown; - public function __construct($response) + public function load(stdClass $response): void { - $this->risk = $response->risk; - $this->country = isset($response->country) ? $response->country : null; - $this->breakdown = isset($response->breakdown) ? $response->breakdown : null; - } + parent::load($response); - public function jsonSerialize() - { - return array_filter([ - 'risk' => $this->risk, - 'country' => $this->country, - 'breakdown' => $this->breakdown - ]); + $this->breakdown = property_exists($response, "breakdown") + ? $response->breakdown + : null; } } -class PoliticalExposureRisk implements \JsonSerializable +class PoliticalExposureRisk extends Model { public ?string $risk; public ?string $checkId; - - public function __construct($response) - { - $this->risk = $response->risk; - $this->checkId = isset($response->checkId) ? $response->checkId : null; - } - - public function jsonSerialize() - { - return array_filter([ - 'risk' => $this->risk, - 'checkId' => $this->checkId - ]); - } } -class OccupationRisk implements \JsonSerializable +class OccupationRisk extends Model { public ?string $risk; public ?string $checkId; public ?string $occupationCategory; public ?string $occupationTitle; - - public function __construct($response) - { - $this->risk = $response->risk; - $this->checkId = isset($response->checkId) ? $response->checkId : null; - $this->occupationCategory = isset($response->occupationCategory) ? $response->occupationCategory : null; - $this->occupationTitle = isset($response->occupationTitle) ? $response->occupationTitle : null; - } - - public function jsonSerialize() - { - return array_filter([ - 'risk' => $this->risk, - 'checkId' => $this->checkId, - 'occupationCategory' => $this->occupationCategory, - 'occupationTitle' => $this->occupationTitle - ]); - } } -class WatchlistRisk implements \JsonSerializable +class WatchlistRisk extends Model { public ?string $risk; public ?string $checkId; - - public function __construct($response) - { - $this->risk = $response->risk; - $this->checkId = isset($response->checkId) ? $response->checkId : null; - } - - public function jsonSerialize() - { - return array_filter([ - 'risk' => $this->risk, - 'checkId' => $this->checkId - ], function ($value) { - return ($value !== null); - }); - } } diff --git a/lib/Model/TeamMember.php b/lib/Model/TeamMember.php index 35835b5..8f5fc32 100644 --- a/lib/Model/TeamMember.php +++ b/lib/Model/TeamMember.php @@ -2,33 +2,13 @@ namespace ComplyCube\Model; -class TeamMember implements \JsonSerializable -{ - public ?string $id = null; - public ?string $firstName = null; - public ?string $lastName = null; - public ?string $role = null; - public ?string $createdAt = null; - - public function load(\stdClass $response) - { - $this->id = $response->id; - $this->firstName = isset($response->firstName) ? $response->firstName : null; - $this->lastName = isset($response->lastName) ? $response->lastName : null; - $this->role = $response->role; - $this->createdAt = $response->createdAt; - } +use Carbon\Carbon; - public function jsonSerialize() - { - return array_filter([ - 'id' => $this->id, - 'firstName' => $this->firstName, - 'lastName' => $this->lastName, - 'role' => $this->role, - 'createdAt' => $this->createdAt - ], function ($value) { - return ($value !== null); - }); - } +class TeamMember extends Model +{ + public ?string $id; + public ?string $firstName; + public ?string $lastName; + public ?string $role; + protected ?Carbon $createdAt; } diff --git a/lib/Model/Token.php b/lib/Model/Token.php index 70c5dfc..003b19e 100644 --- a/lib/Model/Token.php +++ b/lib/Model/Token.php @@ -2,23 +2,7 @@ namespace ComplyCube\Model; -use \stdClass; - -class Token implements \JsonSerializable +class Token extends Model { - public ?string $token = null; - - public function load(stdClass $response) - { - $this->token = $response->token; - } - - public function jsonSerialize() - { - return array_filter([ - 'token' => $this->token - ], function ($value) { - return ($value !== null); - }); - } + public ?string $token; } diff --git a/lib/Model/Validation.php b/lib/Model/Validation.php index e08b37a..d89b666 100644 --- a/lib/Model/Validation.php +++ b/lib/Model/Validation.php @@ -2,27 +2,14 @@ namespace ComplyCube\Model; -use \stdClass; - -class Validation implements \JsonSerializable +class Validation extends Model { - public string $outcome; - public ?string $matchId = null; - public ?string $comment = null; + public ?string $outcome; + public ?string $matchId; + public ?string $comment; public function __construct(string $outcome) { - $this->outcome = $outcome; - } - - public function jsonSerialize() - { - return array_filter([ - 'outcome' => $this->outcome, - 'matchId' => $this->matchId, - 'comment' => $this->comment - ], function ($value) { - return ($value !== null); - }); + $this->load((object) compact("outcome")); } } diff --git a/lib/Model/Webhook.php b/lib/Model/Webhook.php index 7c09199..f26f0bf 100644 --- a/lib/Model/Webhook.php +++ b/lib/Model/Webhook.php @@ -2,38 +2,26 @@ namespace ComplyCube\Model; -use \stdClass; +use Carbon\Carbon; +use stdClass; -class Webhook implements \JsonSerializable +class Webhook extends Model { - public ?string $id = null; - public ?bool $enabled = null; - public ?string $description = null; - public ?string $url = null; - public ?string $secret = null; - public $events = null; + public ?string $id; + public ?string $description; + public ?string $url; + public ?bool $enabled; + public ?array $events; + public ?string $secret; + protected ?Carbon $createdAt; + protected ?Carbon $updatedAt; - public function load(stdClass $response) + public function load(stdClass $response): void { - $this->id = isset($response->id) ? $response->id : null; - $this->description = isset($response->description) ? $response->description : null; - $this->url = isset($response->url) ? $response->url : null; - $this->secret = isset($response->secret) ? $response->secret : null; - $this->events = isset($response->events) ? $response->events : null; - $this->enabled = isset($response->enabled) ? $response->enabled : null; - } + parent::load($response); - public function jsonSerialize() - { - return array_filter([ - 'id' => $this->id, - 'description' => $this->description, - 'url' => $this->url, - 'events' => $this->events, - 'secret' => $this->secret, - 'enabled' => $this->enabled - ], function ($value) { - return ($value !== null); - }); + $this->events = property_exists($response, "events") + ? $response->events + : null; } } diff --git a/lib/ResourceActions/CreateResource.php b/lib/ResourceActions/CreateResource.php index 2f6c426..19d480a 100644 --- a/lib/ResourceActions/CreateResource.php +++ b/lib/ResourceActions/CreateResource.php @@ -4,18 +4,12 @@ trait CreateResource { - /** - * Create instance of resource - * - * @param $data array or object to be posted - * @param array $options request options - * @return stdClass - */ public function create($data, $options = []) { - $response = $this->apiClient->post($this::ENDPOINT, $options, $data); - $resource = new $this->resourceClass(); - $resource->load($response->getDecodedBody()); - return $resource; + return new $this->resourceClass( + $this->apiClient + ->post($this::ENDPOINT, $options, $data) + ->getDecodedBody() + ); } } diff --git a/lib/ResourceActions/DeleteResource.php b/lib/ResourceActions/DeleteResource.php index e279804..d33cd19 100644 --- a/lib/ResourceActions/DeleteResource.php +++ b/lib/ResourceActions/DeleteResource.php @@ -6,6 +6,6 @@ trait DeleteResource { public function delete(string $id, $options = []): void { - $this->apiClient->delete($this::ENDPOINT . '/' . $id, $options); + $this->apiClient->delete($this::ENDPOINT . "/" . $id, $options); } } diff --git a/lib/ResourceActions/GetDirectResource.php b/lib/ResourceActions/GetDirectResource.php index 0347cb6..e5f464c 100644 --- a/lib/ResourceActions/GetDirectResource.php +++ b/lib/ResourceActions/GetDirectResource.php @@ -6,9 +6,10 @@ trait GetDirectResource { public function get($queryParams = [], $options = []) { - $response = $this->apiClient->get($this::ENDPOINT, array_merge($queryParams, $options)); - $resource = new $this->resourceClass(); - $resource->load($response->getDecodedBody()); - return $resource; + return new $this->resourceClass( + $this->apiClient + ->get($this::ENDPOINT, array_merge($queryParams, $options)) + ->getDecodedBody() + ); } } diff --git a/lib/ResourceActions/GetResource.php b/lib/ResourceActions/GetResource.php index 8cf7216..c1fdc9f 100644 --- a/lib/ResourceActions/GetResource.php +++ b/lib/ResourceActions/GetResource.php @@ -6,9 +6,13 @@ trait GetResource { public function get(string $id, $queryParams = [], $options = []) { - $response = $this->apiClient->get($this::ENDPOINT . '/' . $id, array_merge($queryParams, $options)); - $resource = new $this->resourceClass(); - $resource->load($response->getDecodedBody()); - return $resource; + return new $this->resourceClass( + $this->apiClient + ->get( + $this::ENDPOINT . "/" . $id, + array_merge($queryParams, $options) + ) + ->getDecodedBody() + ); } } diff --git a/lib/ResourceActions/ListResource.php b/lib/ResourceActions/ListResource.php index d8057bf..a39f703 100644 --- a/lib/ResourceActions/ListResource.php +++ b/lib/ResourceActions/ListResource.php @@ -2,11 +2,20 @@ namespace ComplyCube\ResourceActions; +use ComplyCube\Model\ComplyCubeCollection; + trait ListResource { - public function list($queryParams = [], $options = []): \ComplyCube\Model\ComplyCubeCollection + public function list($queryParams = [], $options = []): ComplyCubeCollection { - $response = $this->apiClient->get($this::ENDPOINT, array_merge(['query' => $queryParams], $options)); - return new \ComplyCube\Model\ComplyCubeCollection($this->resourceClass, $response->getDecodedBody()); + return new ComplyCubeCollection( + $this->resourceClass, + $this->apiClient + ->get( + $this::ENDPOINT, + array_merge(["query" => $queryParams], $options) + ) + ->getDecodedBody() + ); } } diff --git a/lib/ResourceActions/SearchResource.php b/lib/ResourceActions/SearchResource.php new file mode 100644 index 0000000..5a8f69c --- /dev/null +++ b/lib/ResourceActions/SearchResource.php @@ -0,0 +1,30 @@ +resourceClass, + $this->apiClient + ->post("lookup" . "/" . $this::ENDPOINT, $options, $data) + ->getDecodedBody() + ); + } + + public function get(string $id, $queryParams = [], $options = []) + { + return new $this->resourceClass( + $this->apiClient + ->get( + "lookup" . "/" . $this::ENDPOINT . "/" . $id, + array_merge($queryParams, $options) + ) + ->getDecodedBody() + ); + } +} diff --git a/lib/ResourceActions/UpdateResource.php b/lib/ResourceActions/UpdateResource.php index 4d2f2ea..f66650b 100644 --- a/lib/ResourceActions/UpdateResource.php +++ b/lib/ResourceActions/UpdateResource.php @@ -6,9 +6,10 @@ trait UpdateResource { public function update(string $id, $data, $options = []) { - $response = $this->apiClient->post($this::ENDPOINT . '/' . $id, $options, $data); - $resource = new $this->resourceClass(); - $resource->load($response->getDecodedBody()); - return $resource; + return new $this->resourceClass( + $this->apiClient + ->post($this::ENDPOINT . "/" . $id, $options, $data) + ->getDecodedBody() + ); } } diff --git a/lib/Resources/AccountInfoApi.php b/lib/Resources/AccountInfoApi.php index 9b7776d..10df390 100644 --- a/lib/Resources/AccountInfoApi.php +++ b/lib/Resources/AccountInfoApi.php @@ -2,14 +2,18 @@ namespace ComplyCube\Resources; -class AccountInfoApi extends \ComplyCube\ApiResource +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\ResourceActions\GetDirectResource; + +class AccountInfoApi extends ApiResource { - const ENDPOINT = 'accountInfo'; + const ENDPOINT = "accountInfo"; - use \ComplyCube\ResourceActions\GetDirectResource; + use GetDirectResource; - public function __construct(\ComplyCube\ApiClient $apiClient) + public function __construct(ApiClient $apiClient) { - parent::__construct($apiClient, '\ComplyCube\Model\AccountInfo'); + parent::__construct($apiClient, "\ComplyCube\Model\AccountInfo"); } } diff --git a/lib/Resources/AddressApi.php b/lib/Resources/AddressApi.php index 4aa95f1..f4aed82 100644 --- a/lib/Resources/AddressApi.php +++ b/lib/Resources/AddressApi.php @@ -2,30 +2,46 @@ namespace ComplyCube\Resources; -class AddressApi extends \ComplyCube\ApiResource +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\Model\Address; +use ComplyCube\Model\ComplyCubeCollection; +use ComplyCube\ResourceActions\CreateResource; +use ComplyCube\ResourceActions\DeleteResource; +use ComplyCube\ResourceActions\GetResource; +use ComplyCube\ResourceActions\ListResource; +use ComplyCube\ResourceActions\SearchResource; +use ComplyCube\ResourceActions\UpdateResource; + +class AddressApi extends ApiResource { - const ENDPOINT = 'addresses'; + const ENDPOINT = "addresses"; - use \ComplyCube\ResourceActions\GetResource; - use \ComplyCube\ResourceActions\UpdateResource; - use \ComplyCube\ResourceActions\DeleteResource; + use GetResource, UpdateResource, DeleteResource, SearchResource { + GetResource::get insteadof SearchResource; + } - public function __construct(\ComplyCube\ApiClient $apiClient) - { - parent::__construct($apiClient, '\ComplyCube\Model\Address'); + use CreateResource { + CreateResource::create as traitCreate; + } + + use ListResource { + ListResource::list as traitList; } - use \ComplyCube\ResourceActions\CreateResource { - \ComplyCube\ResourceActions\CreateResource::create as traitCreate; + public function __construct(ApiClient $apiClient) + { + parent::__construct($apiClient, "\ComplyCube\Model\Address"); } /** * Creates a new address. * - * @param $clientId client to assign new address to. + * @param string $clientId client to assign new address to. + * @param mixed $address address data * @return Address */ - public function create(string $clientId, $address) + public function create(string $clientId, $address): Address { if (is_array($address)) { $address["clientId"] = $clientId; @@ -35,19 +51,18 @@ public function create(string $clientId, $address) return $this->traitCreate($address); } - use \ComplyCube\ResourceActions\ListResource { - \ComplyCube\ResourceActions\ListResource::list as traitList; - } - /** * List out addresses belonging to client. * - * @param $clientId client whose addresses to retrieve. - * @return Address + * @param string $clientId client whose addresses to retrieve. + * @param mixed $queryParams query parameters. + * @return ComplyCubeCollection */ - public function list(string $clientId, $queryParams = []) - { - $queryParams['clientId'] = $clientId; + public function list( + string $clientId, + $queryParams = [] + ): ComplyCubeCollection { + $queryParams["clientId"] = $clientId; return $this->traitList($queryParams); } } diff --git a/lib/Resources/AuditLogApi.php b/lib/Resources/AuditLogApi.php index eb324d7..7e6339c 100644 --- a/lib/Resources/AuditLogApi.php +++ b/lib/Resources/AuditLogApi.php @@ -2,15 +2,19 @@ namespace ComplyCube\Resources; -class AuditLogApi extends \ComplyCube\ApiResource +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\ResourceActions\GetResource; +use ComplyCube\ResourceActions\ListResource; + +class AuditLogApi extends ApiResource { - const ENDPOINT = 'auditLogs'; + const ENDPOINT = "auditLogs"; - use \ComplyCube\ResourceActions\GetResource; - use \ComplyCube\ResourceActions\ListResource; + use GetResource, ListResource; - public function __construct(\ComplyCube\ApiClient $apiClient) + public function __construct(ApiClient $apiClient) { - parent::__construct($apiClient, '\ComplyCube\Model\AuditLog'); + parent::__construct($apiClient, "\ComplyCube\Model\AuditLog"); } } diff --git a/lib/Resources/CheckApi.php b/lib/Resources/CheckApi.php index de8c72c..3287343 100644 --- a/lib/Resources/CheckApi.php +++ b/lib/Resources/CheckApi.php @@ -2,34 +2,38 @@ namespace ComplyCube\Resources; -use \ComplyCube\Model\Validation; - -class CheckApi extends \ComplyCube\ApiResource +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\Model\Check; +use ComplyCube\Model\Validation; +use ComplyCube\ResourceActions\CreateResource; +use ComplyCube\ResourceActions\GetResource; +use ComplyCube\ResourceActions\ListResource; +use ComplyCube\ResourceActions\UpdateResource; + +class CheckApi extends ApiResource { - const ENDPOINT = 'checks'; + const ENDPOINT = "checks"; - use \ComplyCube\ResourceActions\GetResource; - use \ComplyCube\ResourceActions\CreateResource; - use \ComplyCube\ResourceActions\UpdateResource; - use \ComplyCube\ResourceActions\ListResource; + use GetResource, UpdateResource, ListResource; - public function __construct(\ComplyCube\ApiClient $apiClient) - { - parent::__construct($apiClient, '\ComplyCube\Model\Check'); + use CreateResource { + CreateResource::create as traitCreate; } - use \ComplyCube\ResourceActions\CreateResource { - \ComplyCube\ResourceActions\CreateResource::create as traitCreate; + public function __construct(ApiClient $apiClient) + { + parent::__construct($apiClient, "\ComplyCube\Model\Check"); } /** * Creates a new Check. * - * @param $clientId of the client. - * @param $document document object/array of detail. + * @param string $clientId of the client. + * @param mixed $check object/array of detail. * @return Check */ - public function create(string $clientId, $check) + public function create(string $clientId, $check): Check { if (is_array($check)) { $check["clientId"] = $clientId; @@ -43,12 +47,16 @@ public function create(string $clientId, $check) * Validates outcome of the specified check. * * @param string $checkId being validated. - * @param $validation details to be applied. + * @param mixed $validation details to be applied. * @return Validation */ public function validate(string $checkId, $validation): Validation { - $response = $this->apiClient->post($this::ENDPOINT . '/' . $checkId .'/validate', [], $validation); + $response = $this->apiClient->post( + $this::ENDPOINT . "/" . $checkId . "/validate", + [], + $validation, + ); $validation = new Validation($response->getDecodedBody()->outcome); return $validation; } diff --git a/lib/Resources/ClientApi.php b/lib/Resources/ClientApi.php index fa938c0..0a18139 100644 --- a/lib/Resources/ClientApi.php +++ b/lib/Resources/ClientApi.php @@ -2,18 +2,26 @@ namespace ComplyCube\Resources; -class ClientApi extends \ComplyCube\ApiResource +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\ResourceActions\CreateResource; +use ComplyCube\ResourceActions\DeleteResource; +use ComplyCube\ResourceActions\GetResource; +use ComplyCube\ResourceActions\ListResource; +use ComplyCube\ResourceActions\UpdateResource; + +class ClientApi extends ApiResource { - const ENDPOINT = 'clients'; + const ENDPOINT = "clients"; - use \ComplyCube\ResourceActions\GetResource; - use \ComplyCube\ResourceActions\CreateResource; - use \ComplyCube\ResourceActions\UpdateResource; - use \ComplyCube\ResourceActions\DeleteResource; - use \ComplyCube\ResourceActions\ListResource; + use GetResource, + CreateResource, + UpdateResource, + DeleteResource, + ListResource; - public function __construct(\ComplyCube\ApiClient $apiClient) + public function __construct(ApiClient $apiClient) { - parent::__construct($apiClient, '\ComplyCube\Model\Client'); + parent::__construct($apiClient, "\ComplyCube\Model\Client"); } } diff --git a/lib/Resources/CompanyApi.php b/lib/Resources/CompanyApi.php new file mode 100644 index 0000000..8629036 --- /dev/null +++ b/lib/Resources/CompanyApi.php @@ -0,0 +1,19 @@ +apiClient->post( + $this::ENDPOINT . "/" . $id . "/records", + [], + $data + ); + } +} diff --git a/lib/Resources/DocumentApi.php b/lib/Resources/DocumentApi.php index 97f2b3c..63c09f8 100644 --- a/lib/Resources/DocumentApi.php +++ b/lib/Resources/DocumentApi.php @@ -2,34 +2,44 @@ namespace ComplyCube\Resources; +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\Model\ComplyCubeCollection; +use ComplyCube\Model\Document; use ComplyCube\Model\Image; +use ComplyCube\ResourceActions\CreateResource; +use ComplyCube\ResourceActions\DeleteResource; +use ComplyCube\ResourceActions\GetResource; +use ComplyCube\ResourceActions\ListResource; +use ComplyCube\ResourceActions\UpdateResource; -class DocumentApi extends \ComplyCube\ApiResource +class DocumentApi extends ApiResource { - const ENDPOINT = 'documents'; + const ENDPOINT = "documents"; - use \ComplyCube\ResourceActions\GetResource; - use \ComplyCube\ResourceActions\CreateResource; - use \ComplyCube\ResourceActions\UpdateResource; - use \ComplyCube\ResourceActions\DeleteResource; + use GetResource, DeleteResource, UpdateResource; - public function __construct(\ComplyCube\ApiClient $apiClient) - { - parent::__construct($apiClient, '\ComplyCube\Model\Document'); + use CreateResource { + CreateResource::create as traitCreate; + } + + use ListResource { + ListResource::list as traitList; } - use \ComplyCube\ResourceActions\CreateResource { - \ComplyCube\ResourceActions\CreateResource::create as traitCreate; + public function __construct(ApiClient $apiClient) + { + parent::__construct($apiClient, "\ComplyCube\Model\Document"); } /** * Creates a new Document. * - * @param $clientId client to assign documents to. - * @param $document document object/array of detail. + * @param string $clientId client to assign documents to. + * @param mixed $document document object/array of detail. * @return Document */ - public function create(string $clientId, $document) + public function create(string $clientId, $document): Document { if (is_array($document)) { $document["clientId"] = $clientId; @@ -44,12 +54,16 @@ public function create(string $clientId, $document) * * @param string $id of the document to upload to. * @param string $side of the document being uploaded. - * @param $documentImage object/array of image detail. + * @param mixed $documentImage object/array of image detail. * @return Image */ public function upload(string $id, string $side, $documentImage): Image { - $response = $this->apiClient->post($this::ENDPOINT . '/' . $id . '/upload/' . $side, [], $documentImage); + $response = $this->apiClient->post( + $this::ENDPOINT . "/" . $id . "/upload/" . $side, + [], + $documentImage, + ); $img = new Image(); $img->load($response->getDecodedBody()); return $img; @@ -64,24 +78,40 @@ public function upload(string $id, string $side, $documentImage): Image */ public function download(string $id, string $side): Image { - $response = $this->apiClient->get($this::ENDPOINT . '/' . $id . '/download/' . $side, []); + $response = $this->apiClient->get( + $this::ENDPOINT . "/" . $id . "/download/" . $side, + [], + ); $img = new Image(); $img->load($response->getDecodedBody()); return $img; } + /** + * + * + * @param string $id + * @param string $side + * @return void + */ + public function deleteImage(string $id, string $side): void { - $this->apiClient->get($this::ENDPOINT . '/' . $id . '/' . $side, []); - } - - use \ComplyCube\ResourceActions\ListResource { - \ComplyCube\ResourceActions\ListResource::list as traitList; + $this->apiClient->get($this::ENDPOINT . "/" . $id . "/" . $side, []); } - public function list(string $clientId, $queryParams = []) - { - $queryParams['clientId'] = $clientId; + /** + * List out documents belonging to client. + * + * @param string $clientId client whose documents to retrieve. + * @param mixed $queryParams query parameters. + * @return ComplyCubeCollection + */ + public function list( + string $clientId, + $queryParams = [] + ): ComplyCubeCollection { + $queryParams["clientId"] = $clientId; return $this->traitList($queryParams); } } diff --git a/lib/Resources/FlowSessionApi.php b/lib/Resources/FlowSessionApi.php index df360e3..57c1f50 100644 --- a/lib/Resources/FlowSessionApi.php +++ b/lib/Resources/FlowSessionApi.php @@ -2,26 +2,31 @@ namespace ComplyCube\Resources; -class FlowSessionApi extends \ComplyCube\ApiResource +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\Model\FlowSession; +use ComplyCube\ResourceActions\CreateResource; + +class FlowSessionApi extends ApiResource { - const ENDPOINT = 'flow/sessions'; + const ENDPOINT = "flow/sessions"; - public function __construct(\ComplyCube\ApiClient $apiClient) - { - parent::__construct($apiClient, '\ComplyCube\Model\FlowSession'); + use CreateResource { + CreateResource::create as traitCreate; } - use \ComplyCube\ResourceActions\CreateResource { - \ComplyCube\ResourceActions\CreateResource::create as traitCreate; + public function __construct(ApiClient $apiClient) + { + parent::__construct($apiClient, "\ComplyCube\Model\FlowSession"); } /** * Creates a new Flow Session. * - * @param $flowSession session options to use. + * @param mixed $flowSession session options to use. * @return FlowSession */ - public function createSession($flowSession) + public function createSession($flowSession): FlowSession { return $this->traitCreate($flowSession); } diff --git a/lib/Resources/LivePhotoApi.php b/lib/Resources/LivePhotoApi.php index dd7a420..92e9822 100644 --- a/lib/Resources/LivePhotoApi.php +++ b/lib/Resources/LivePhotoApi.php @@ -2,32 +2,40 @@ namespace ComplyCube\Resources; +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\Model\ComplyCubeCollection; use ComplyCube\Model\Image; +use ComplyCube\ResourceActions\CreateResource; +use ComplyCube\ResourceActions\DeleteResource; +use ComplyCube\ResourceActions\GetResource; +use ComplyCube\ResourceActions\ListResource; +use ComplyCube\ResourceActions\UpdateResource; -class LivePhotoApi extends \ComplyCube\ApiResource +class LivePhotoApi extends ApiResource { - const ENDPOINT = 'livePhotos'; + const ENDPOINT = "livePhotos"; - use \ComplyCube\ResourceActions\GetResource; - use \ComplyCube\ResourceActions\CreateResource; - use \ComplyCube\ResourceActions\UpdateResource; - use \ComplyCube\ResourceActions\DeleteResource; - use \ComplyCube\ResourceActions\ListResource; + use GetResource, UpdateResource, DeleteResource; - public function __construct(\ComplyCube\ApiClient $apiClient) - { - parent::__construct($apiClient, '\ComplyCube\Model\Image'); + use CreateResource { + CreateResource::create as traitCreate; + } + + use ListResource { + ListResource::list as traitList; } - use \ComplyCube\ResourceActions\CreateResource { - \ComplyCube\ResourceActions\CreateResource::create as traitCreate; + public function __construct(ApiClient $apiClient) + { + parent::__construct($apiClient, "\ComplyCube\Model\Image"); } - + /** * Upload livephoto of a client. * * @param string $clientId of the client being uploaded. - * @param $img object/array of image detail. + * @param mixed $img object/array of image detail. * @return Image */ public function upload(string $clientId, $img): Image @@ -48,23 +56,21 @@ public function upload(string $clientId, $img): Image */ public function download(string $id): Image { - return $this->get($id . '/download'); - } - - use \ComplyCube\ResourceActions\ListResource { - \ComplyCube\ResourceActions\ListResource::list as traitList; + return $this->get($id . "/download"); } /** * List all existing live photos for a given client. * * @param string $clientId of the client. - * @param array $queryParams for pagination and filtering. - * @return void + * @param mixed $queryParams for pagination and filtering. + * @return ComplyCubeCollection */ - public function list(string $clientId, $queryParams = []) - { - $queryParams['clientId'] = $clientId; + public function list( + string $clientId, + $queryParams = [] + ): ComplyCubeCollection { + $queryParams["clientId"] = $clientId; return $this->traitList($queryParams); } } diff --git a/lib/Resources/LiveVideoApi.php b/lib/Resources/LiveVideoApi.php index c7d3e4c..52c6ff0 100644 --- a/lib/Resources/LiveVideoApi.php +++ b/lib/Resources/LiveVideoApi.php @@ -2,35 +2,40 @@ namespace ComplyCube\Resources; -use ComplyCube\Model\LiveVideo; +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\Model\ComplyCubeCollection; +use ComplyCube\ResourceActions\DeleteResource; +use ComplyCube\ResourceActions\GetResource; +use ComplyCube\ResourceActions\ListResource; -class LiveVideoApi extends \ComplyCube\ApiResource +class LiveVideoApi extends ApiResource { - const ENDPOINT = 'liveVideos'; + const ENDPOINT = "liveVideos"; - use \ComplyCube\ResourceActions\GetResource; - use \ComplyCube\ResourceActions\DeleteResource; - use \ComplyCube\ResourceActions\ListResource; + use GetResource, DeleteResource; - public function __construct(\ComplyCube\ApiClient $apiClient) - { - parent::__construct($apiClient, '\ComplyCube\Model\LiveVideo'); + use ListResource { + ListResource::list as traitList; } - use \ComplyCube\ResourceActions\ListResource { - \ComplyCube\ResourceActions\ListResource::list as traitList; + public function __construct(ApiClient $apiClient) + { + parent::__construct($apiClient, "\ComplyCube\Model\LiveVideo"); } /** * List all existing live photos for a given client. * * @param string $clientId of the client. - * @param array $queryParams for pagination and filtering. - * @return void + * @param mixed $queryParams for pagination and filtering. + * @return ComplyCubeCollection */ - public function list(string $clientId, $queryParams = []) - { - $queryParams['clientId'] = $clientId; + public function list( + string $clientId, + $queryParams = [] + ): ComplyCubeCollection { + $queryParams["clientId"] = $clientId; return $this->traitList($queryParams); } } diff --git a/lib/Resources/ReportApi.php b/lib/Resources/ReportApi.php index 6a73f62..7de5b3e 100644 --- a/lib/Resources/ReportApi.php +++ b/lib/Resources/ReportApi.php @@ -2,17 +2,20 @@ namespace ComplyCube\Resources; +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; use ComplyCube\Model\Report; +use ComplyCube\ResourceActions\GetResource; -class ReportApi extends \ComplyCube\ApiResource +class ReportApi extends ApiResource { - const ENDPOINT = 'reports'; + const ENDPOINT = "reports"; - use \ComplyCube\ResourceActions\GetResource; + use GetResource; - public function __construct(\ComplyCube\ApiClient $apiClient) + public function __construct(ApiClient $apiClient) { - parent::__construct($apiClient, '\ComplyCube\Model\Report'); + parent::__construct($apiClient, "\ComplyCube\Model\Report"); } /** @@ -23,6 +26,6 @@ public function __construct(\ComplyCube\ApiClient $apiClient) */ public function generate(array $queryParams): Report { - return $this->get('', ['query'=> $queryParams]); + return $this->get("", ["query" => $queryParams]); } } diff --git a/lib/Resources/RiskProfileApi.php b/lib/Resources/RiskProfileApi.php index fdce690..892f113 100644 --- a/lib/Resources/RiskProfileApi.php +++ b/lib/Resources/RiskProfileApi.php @@ -2,23 +2,31 @@ namespace ComplyCube\Resources; -class RiskProfileApi extends \ComplyCube\ApiResource +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\Model\RiskProfile; +use ComplyCube\ResourceActions\GetResource; + +class RiskProfileApi extends ApiResource { - const ENDPOINT = 'clients'; + const ENDPOINT = "clients"; - use \ComplyCube\ResourceActions\GetResource; + use GetResource { + GetResource::get as traitGet; + } - public function __construct(\ComplyCube\ApiClient $apiClient) + public function __construct(ApiClient $apiClient) { - parent::__construct($apiClient, '\ComplyCube\Model\RiskProfile'); + parent::__construct($apiClient, "\ComplyCube\Model\RiskProfile"); } - use \ComplyCube\ResourceActions\GetResource { - \ComplyCube\ResourceActions\GetResource::get as traitGet; - } + /** + * @param string $id risk profile id + * @return RiskProfile + */ - public function get(string $id) + public function get(string $id): RiskProfile { - return $this->traitGet($id.'/riskProfile'); + return $this->traitGet($id . "/riskProfile"); } } diff --git a/lib/Resources/TeamMemberApi.php b/lib/Resources/TeamMemberApi.php index 2a8f541..103fd99 100644 --- a/lib/Resources/TeamMemberApi.php +++ b/lib/Resources/TeamMemberApi.php @@ -2,15 +2,19 @@ namespace ComplyCube\Resources; -class TeamMemberApi extends \ComplyCube\ApiResource +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\ResourceActions\GetResource; +use ComplyCube\ResourceActions\ListResource; + +class TeamMemberApi extends ApiResource { - const ENDPOINT = 'teamMembers'; + const ENDPOINT = "teamMembers"; - use \ComplyCube\ResourceActions\GetResource; - use \ComplyCube\ResourceActions\ListResource; + use GetResource, ListResource; - public function __construct(\ComplyCube\ApiClient $apiClient) + public function __construct(ApiClient $apiClient) { - parent::__construct($apiClient, '\ComplyCube\Model\TeamMember'); + parent::__construct($apiClient, "\ComplyCube\Model\TeamMember"); } } diff --git a/lib/Resources/TokenApi.php b/lib/Resources/TokenApi.php index 2ef7e7c..338ce7f 100644 --- a/lib/Resources/TokenApi.php +++ b/lib/Resources/TokenApi.php @@ -2,20 +2,32 @@ namespace ComplyCube\Resources; -class TokenApi extends \ComplyCube\ApiResource +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\Model\Token; +use ComplyCube\ResourceActions\CreateResource; + +class TokenApi extends ApiResource { - const ENDPOINT = 'tokens'; + const ENDPOINT = "tokens"; - use \ComplyCube\ResourceActions\CreateResource; + use CreateResource; - public function __construct(\ComplyCube\ApiClient $apiClient) + public function __construct(ApiClient $apiClient) { - parent::__construct($apiClient, '\ComplyCube\Model\Token'); + parent::__construct($apiClient, "\ComplyCube\Model\Token"); } - public function generate(string $clientId, string $referrer): \ComplyCube\Model\Token + public function generate(string $clientId, string $referrer): Token { - $request = ['clientId' => $clientId, 'referrer' => $referrer]; - return $this->create($request); + return $this->create([ + "clientId" => $clientId, + preg_match( + "/(^([A-Za-z0-9]+\.)+[A-Za-z0-9]{2,}$)|(^[a-zA-Z][a-zA-Z0-9_]*(\.[a-zA-Z][a-zA-Z0-9_]*)*$)/", + $referrer + ) + ? "appId" + : "referrer" => $referrer, + ]); } } diff --git a/lib/Resources/WebhookApi.php b/lib/Resources/WebhookApi.php index c6aadec..9b9510c 100644 --- a/lib/Resources/WebhookApi.php +++ b/lib/Resources/WebhookApi.php @@ -2,18 +2,26 @@ namespace ComplyCube\Resources; -class WebhookApi extends \ComplyCube\ApiResource +use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use ComplyCube\ResourceActions\CreateResource; +use ComplyCube\ResourceActions\DeleteResource; +use ComplyCube\ResourceActions\GetResource; +use ComplyCube\ResourceActions\ListResource; +use ComplyCube\ResourceActions\UpdateResource; + +class WebhookApi extends ApiResource { - const ENDPOINT = 'webhooks'; + const ENDPOINT = "webhooks"; - use \ComplyCube\ResourceActions\GetResource; - use \ComplyCube\ResourceActions\CreateResource; - use \ComplyCube\ResourceActions\UpdateResource; - use \ComplyCube\ResourceActions\DeleteResource; - use \ComplyCube\ResourceActions\ListResource; + use GetResource, + CreateResource, + UpdateResource, + DeleteResource, + ListResource; - public function __construct(\ComplyCube\ApiClient $apiClient) + public function __construct(ApiClient $apiClient) { - parent::__construct($apiClient, '\ComplyCube\Model\Webhook'); + parent::__construct($apiClient, "\ComplyCube\Model\Webhook"); } } diff --git a/phpunit.xml b/phpunit.xml index 4fe348f..46444ba 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,29 +1,23 @@ - - - - tests - - - - - lib - - lib/Model - lib/ComplyCubeClient.php - - - - - - + + + + + + + + + tests + + + + + + lib + + + lib/Model + lib/ComplyCubeClient.php + + diff --git a/phpunit.xml.bak b/phpunit.xml.bak new file mode 100644 index 0000000..5cdf919 --- /dev/null +++ b/phpunit.xml.bak @@ -0,0 +1,21 @@ + + + + + lib + + + lib/Model + lib/ComplyCubeClient.php + + + + + + + + tests + + + + diff --git a/tests/integration/AccountInfoTest.php b/tests/integration/AccountInfoTest.php index 6c407a0..95f3a11 100644 --- a/tests/integration/AccountInfoTest.php +++ b/tests/integration/AccountInfoTest.php @@ -2,21 +2,21 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; use ComplyCube\Model\AccountInfo; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\Resources\AccountInfoApi */ -class AccountInfoTest extends \PHPUnit\Framework\TestCase +class AccountInfoTest extends TestCase { - private $complycube; + private ?ComplyCubeClient $complycube; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } } @@ -24,6 +24,7 @@ protected function setUp(): void public function testGetAccountInfo(): void { $result = $this->complycube->accountInfo()->get(); + $this->assertInstanceOf(AccountInfo::class, $result); $this->assertNotNull($result->username); $this->assertNotNull($result->plan); } diff --git a/tests/integration/AddressTest.php b/tests/integration/AddressTest.php index 7e623af..baa0708 100644 --- a/tests/integration/AddressTest.php +++ b/tests/integration/AddressTest.php @@ -2,48 +2,58 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; +use ComplyCube\Exception\ComplyCubeClientException; use ComplyCube\Model\Address; use ComplyCube\Model\Client; -use ComplyCube\Model\PersonDetails; +use ComplyCube\Model\ComplyCubeCollection; +use PHPUnit\Framework\TestCase; +use ReflectionProperty; /** * @covers \ComplyCube\Resources\AddressApi */ -class AddressTest extends \PHPUnit\Framework\TestCase +class AddressTest extends TestCase { - private $complycube; - private $address; - private $personClient; + private ?ComplyCubeClient $complycube; + private ?Address $address; + private ?Client $personClient; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } - $address = new Address(); - $address->line = '11 Something Avenue'; - $address->city = 'London'; - $address->country = 'GB'; - $this->address = $address; - - $personDetails = new PersonDetails(); - $personDetails->firstName = 'John'; - $personDetails->lastName = 'Smith'; - $newClient = new Client(); - $newClient->type = 'person'; - $newClient->email = 'john@doe.com'; - $newClient->personDetails = $personDetails; - $this->personClient = $newClient; + + $this->address = new Address([ + "line" => "11 Something Avenue", + "city" => "London", + "country" => "GB", + "postalCode" => "E14 4PP" + ]); + + $this->personClient = new Client([ + "type" => "person", + "email" => "john@doe.com", + "personDetails" => [ + "firstName" => "John", + "lastName" => "Smith", + ], + ]); } public function testCreatePersonForAddress(): string { $result = $this->complycube->clients()->create($this->personClient); - $this->assertEquals($this->personClient->personDetails->firstName, $result->personDetails->firstName); - $this->assertEquals($this->personClient->personDetails->lastName, $result->personDetails->lastName); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); $this->assertEquals($this->personClient->email, $result->email); $this->assertEquals($this->personClient->type, $result->type); return $result->id; @@ -52,18 +62,20 @@ public function testCreatePersonForAddress(): string public function testGetNonExistentAddress() { try { - $this->complycube->address()->get('nonexistentaddressid'); - } catch (\ComplyCube\Exception\ComplyCubeClientException $e) { + $this->complycube->address()->get("nonexistentaddressid"); + } catch (ComplyCubeClientException $e) { $this->assertEquals($e->getCode(), 404); } } - + /** - * @depends testCreatePersonForAddress - */ + * @depends testCreatePersonForAddress + */ public function testCreateAddress($clientId): Address { - $result = $this->complycube->address()->create($clientId, $this->address); + $result = $this->complycube + ->address() + ->create($clientId, $this->address); $this->assertEquals($this->address->line, $result->line); $this->assertEquals($this->address->city, $result->city); $this->assertEquals($this->address->country, $result->country); @@ -71,76 +83,73 @@ public function testCreateAddress($clientId): Address } /** - * @depends testCreatePersonForAddress - */ + * @depends testCreatePersonForAddress + */ public function testCreateAddressInvalidType($clientId) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $invalidType = $this->address; - $invalidType->type = 'INVALIDTYPE'; - $result = $this->complycube->address()->create($clientId, $this->address); + $this->expectException(ComplyCubeClientException::class); + $this->address->type = "INVALIDTYPE"; + $this->complycube->address()->create($clientId, $this->address); } /** - * @depends testCreatePersonForAddress - */ - public function testCreateInvalidCountryAddress($clientId): string + * @depends testCreatePersonForAddress + */ + public function testCreateInvalidCountryAddress($clientId) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $invalidCountryAddress = $this->address; - $invalidCountryAddress->country = 'J{'; - $result = $this->complycube->address()->create($clientId, $this->address); + $this->expectException(ComplyCubeClientException::class); + $this->address->country = "J{"; + $this->complycube->address()->create($clientId, $this->address); } /** - * @depends testCreatePersonForAddress - */ - public function testCreateAddressMissingLine($clientId): string + * @depends testCreatePersonForAddress + */ + public function testCreateAddressMissingLine($clientId) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $invalidAddress = $this->address; - $invalidAddress->line = null; - $result = $this->complycube->address()->create($clientId, $this->address); + $this->expectException(ComplyCubeClientException::class); + $this->address->line = null; + $this->complycube->address()->create($clientId, $this->address); } /** - * @depends testCreatePersonForAddress - */ + * @depends testCreatePersonForAddress + */ public function testCreateAddressInLine($clientId) { - $result = $this->complycube->address()->create($clientId, [ 'line' => '11 Something Avenue', - 'city' => 'London', - 'country' => 'GB']); + $result = $this->complycube->address()->create($clientId, [ + "line" => "11 Something Avenue", + "city" => "London", + "country" => "GB", + ]); $this->assertEquals($this->address->line, $result->line); $this->assertEquals($this->address->city, $result->city); $this->assertEquals($this->address->country, $result->country); } /** - * @depends testCreatePersonForAddress - */ - public function testCreateAddressMissingCity($clientId): string + * @depends testCreatePersonForAddress + */ + public function testCreateAddressMissingCity($clientId) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $invalidAddress = $this->address; - $invalidAddress->city = null; - $result = $this->complycube->address()->create($clientId, $this->address); + $this->expectException(ComplyCubeClientException::class); + $this->address->city = null; + $this->complycube->address()->create($clientId, $this->address); } /** - * @depends testCreatePersonForAddress - */ - public function testCreateAddressMissingCountry($clientId): string + * @depends testCreatePersonForAddress + */ + public function testCreateAddressMissingCountry($clientId) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $invalidAddress = $this->address; - $invalidAddress->country = null; - $result = $this->complycube->address()->create($clientId, $this->address); + $this->expectException(ComplyCubeClientException::class); + $this->address->country = null; + $this->complycube->address()->create($clientId, $this->address); } /** - * @depends testCreateAddress - */ + * @depends testCreateAddress + */ public function testGetAddress($address): void { $result = $this->complycube->address()->get($address->id); @@ -150,32 +159,32 @@ public function testGetAddress($address): void } /** - * @depends testCreateAddress - */ + * @depends testCreateAddress + */ public function testUpdateAddress($address): void { - $updatedAddress = new Address(); - $updatedAddress->country = 'US'; - $result = $this->complycube->address()->update($address->id, $updatedAddress); + $result = $this->complycube->address()->update($address->id, [ + "country" => "US", + ]); $this->assertEquals($this->address->line, $result->line); $this->assertEquals($this->address->city, $result->city); - $this->assertEquals('US', $result->country); + $this->assertEquals("US", $result->country); } /** - * @depends testCreateAddress - */ + * @depends testCreateAddress + */ public function testUpdateAddressInvalidCountryCode($address): void { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $updatedAddress = new Address(); - $updatedAddress->country = 'NOTACOUNTRYCODE'; - $result = $this->complycube->address()->update($address->id, $updatedAddress); + $this->expectException(ComplyCubeClientException::class); + $this->complycube->address()->update($address->id, [ + "country" => "NOTACOUNTRYCODE", + ]); } /** - * @depends testCreateAddress - */ + * @depends testCreateAddress + */ public function testListAddress($address): void { $addresslist = $this->complycube->address()->list($address->clientId); @@ -183,37 +192,103 @@ public function testListAddress($address): void } /** - * @depends testCreatePersonForAddress - */ + * @depends testCreatePersonForAddress + */ public function testList2AddressesOnly($clientId): void { - $newAdd = $this->address; - $result = $this->complycube->address()->create($clientId, $newAdd); - $newAdd->city = 'New York'; - $result = $this->complycube->address()->create($clientId, $newAdd); - $newAdd->city = 'Chicago'; - $result = $this->complycube->address()->create($clientId, $newAdd); - $addresslist = $this->complycube->address()->list($newAdd->clientId, ['page' => 1, 'pageSize' => 2]); + $this->complycube->address()->create($clientId, $this->address); + $this->address->city = "New York"; + $this->complycube->address()->create($clientId, $this->address); + $this->address->city = "Chicago"; + $this->complycube->address()->create($clientId, $this->address); + $addresslist = $this->complycube + ->address() + ->list($clientId, ["page" => 1, "pageSize" => 2]); $this->assertEquals(2, iterator_count($addresslist)); } /** - * @depends testCreateAddress - */ + * @depends testCreateAddress + */ public function testFilterAddressesLondonOnly($address): void { - $addresslist = $this->complycube->address()->list($address->clientId, ['city' => 'London']); + $addresslist = $this->complycube + ->address() + ->list($address->clientId, ["city" => "London"]); foreach ($addresslist as $anAddress) { - $this->assertEquals('London', $anAddress->city); + $this->assertEquals("London", $anAddress->city); } } /** - * @depends testCreateAddress - */ + * @depends testCreateAddress + */ + public function atestSearchAddress(): void + { + $result = $this->complycube->address()->search([ + "line" => "11 Something Avenue", + "country" => "GB", + "postalCode" => "E14 4PP", + ]); + + $this->assertInstanceOf(ComplyCubeCollection::class, $result); + + $this->assertCount(1, $result); + + foreach ($result->items as $item) { + $this->assertInstanceOf(Address::class, $item); + + foreach ( + ["line", "city", "state", "postalCode", "country"] + as $key + ) { + $this->assertNotNull($item->$key); + } + + foreach (["createdAt", "updatedAt"] as $property_name) { + $item_reflection_property = new ReflectionProperty( + $item, + $property_name + ); + + $item_reflection_property->setAccessible(true); + + $this->assertNull($item_reflection_property->getValue($item)); + } + + foreach ( + [ + "id", + "clientId", + "type", + "propertyNumber", + "buildingName", + "fromDate", + "toDate", + ] + as $key + ) { + $this->assertNull($item->$key); + } + } + } + + public function testSearchAddressWithInvalidParameters(): void + { + $this->expectException(ComplyCubeClientException::class); + $this->complycube->address()->search([ + "param_1" => "qzdqzd", + "param_2" => "90001", + "param_3" => "GB", + ]); + } + + /** + * @depends testCreateAddress + */ public function testDeleteAddress($address): void { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $this->complycube->address()->delete($address->id); $this->complycube->address()->get($address->id); } diff --git a/tests/integration/AuditLogTest.php b/tests/integration/AuditLogTest.php index ebe216f..95344bb 100644 --- a/tests/integration/AuditLogTest.php +++ b/tests/integration/AuditLogTest.php @@ -2,25 +2,21 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; +use Carbon\Carbon; use ComplyCube\ComplyCubeClient; -use ComplyCube\Model\Report; - -use ComplyCube\Model\Check; -use ComplyCube\Model\Client; -use ComplyCube\Model\PersonDetails; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\Resources\AuditLogApi */ -class AuditLogTest extends \PHPUnit\Framework\TestCase +class AuditLogTest extends TestCase { - private $complycube; + private ?ComplyCubeClient $complycube; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } } @@ -34,25 +30,25 @@ public function testListAuditLogs(): string public function testListOnly10AuditLogs() { - $result = $this->complycube->AuditLogs()->list(['pageSize' => 10]); + $result = $this->complycube->AuditLogs()->list(["pageSize" => 10]); $this->assertEquals(10, iterator_count($result)); } public function testFilterUpdateOnly() { - $result = $this->complycube->AuditLogs()->list(['action' => 'update']); + $result = $this->complycube->AuditLogs()->list(["action" => "update"]); foreach ($result as $res) { - $this->assertEquals('update', $res->action); + $this->assertEquals("update", $res->action); } } /** - * @depends testListAuditLogs - */ + * @depends testListAuditLogs + */ public function testGetAuditLog($id) { $result = $this->complycube->AuditLogs()->get($id); $this->assertEquals($id, $result->id); - $this->assertLessThan(new \DateTime('NOW'), $result->createdAt); + $this->assertLessThan(Carbon::now(), $result->createdAt); } } diff --git a/tests/integration/CheckTest.php b/tests/integration/CheckTest.php index 5be9736..bc223f9 100644 --- a/tests/integration/CheckTest.php +++ b/tests/integration/CheckTest.php @@ -2,165 +2,189 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; +use ComplyCube\Exception\ComplyCubeClientException; use ComplyCube\Model\Check; use ComplyCube\Model\CheckOptions; +use ComplyCube\Model\Client; use ComplyCube\Model\Image; -use ComplyCube\Model\Validation; use ComplyCube\Model\PersonDetails; -use ComplyCube\Model\Client; +use ComplyCube\Model\Validation; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\Resources\CheckApi */ -class CheckTest extends \PHPUnit\Framework\TestCase +class CheckTest extends TestCase { - private $check; - private $complycube; + private ?Check $check; + private ?ComplyCubeClient $complycube; + private ?Client $personClient; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } - + $personDetails = new PersonDetails(); - $personDetails->firstName = 'John'; - $personDetails->lastName = 'Doe'; - $personDetails->middleName = 'medium-risk'; + $personDetails->firstName = "Boris"; + $personDetails->lastName = "Johnson"; $newClient = new Client(); - $newClient->type = 'person'; - $newClient->email = 'john@doe.com'; + $newClient->type = "person"; + $newClient->email = "john@doe.com"; $newClient->personDetails = $personDetails; $this->personClient = $newClient; $check = new Check(); - $check->type = 'extensive_screening_check'; + $check->type = "extensive_screening_check"; $this->check = $check; } public function testCreatePersonClient(): string { $result = $this->complycube->clients()->create($this->personClient); - $this->assertEquals($this->personClient->personDetails->firstName, $result->personDetails->firstName); - $this->assertEquals($this->personClient->personDetails->lastName, $result->personDetails->lastName); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); $this->assertEquals($this->personClient->email, $result->email); $this->assertEquals($this->personClient->type, $result->type); return $result->id; } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testCreateDocument($clientId): string { - $result = $this->complycube->documents()->create($clientId, ['type' => 'driving_license', 'issuingCountry' => 'GB']); - $this->assertEquals('driving_license', $result->type); + $result = $this->complycube->documents()->create($clientId, [ + "type" => "driving_license", + "issuingCountry" => "GB", + ]); + $this->assertEquals("driving_license", $result->type); $this->assertEquals($clientId, $result->clientId); return $result->id; } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testCreateAddress($clientId): string { - $testAddress = [ 'line' => '11 Something Avenue', 'city' => 'London', 'country' => 'GB']; + $testAddress = [ + "line" => "11 Something Avenue", + "city" => "London", + "country" => "GB", + ]; $result = $this->complycube->address()->create($clientId, $testAddress); - $this->assertEquals($testAddress['line'], $result->line); - $this->assertEquals($testAddress['city'], $result->city); - $this->assertEquals($testAddress['country'], $result->country); + $this->assertEquals($testAddress["line"], $result->line); + $this->assertEquals($testAddress["city"], $result->city); + $this->assertEquals($testAddress["country"], $result->country); return $result->id; } /** - * @depends testCreateDocument - */ + * @depends testCreateDocument + */ public function testUploadImageToDocument($documentId): Image { $image = new Image(); - $image->fileName = 'front.jpg'; - $image->data = file_get_contents("./tests/fixtures/encoded-20200609153459.txt", "r"); - $result = $this->complycube->documents()->upload($documentId, 'front', $image); + $image->fileName = "front.jpg"; + $image->data = file_get_contents( + "./tests/fixtures/encoded-20200609153459.txt" + ); + $result = $this->complycube + ->documents() + ->upload($documentId, "front", $image); $this->assertEquals($image->fileName, $result->fileName); - $this->assertEquals('front', $result->documentSide); - $this->assertEquals('image/jpg', $result->contentType); + $this->assertEquals("front", $result->documentSide); + $this->assertEquals("image/jpg", $result->contentType); return $result; } /** - * @depends testCreatePersonClient - * @depends testCreateDocument - */ + * @depends testCreatePersonClient + * @depends testCreateDocument + */ public function testCreateDocumentCheck($clientId, $documentId): string { - $result = $this->complycube->checks()->create($clientId, ['type' => 'document_check', 'documentId' => $documentId]); - $this->assertObjectHasAttribute('id', $result); - $this->assertEquals('document_check', $result->type); + $result = $this->complycube->checks()->create($clientId, [ + "type" => "document_check", + "documentId" => $documentId, + ]); + $this->assertTrue(property_exists($result, "id")); + $this->assertEquals("document_check", $result->type); $this->assertEquals($clientId, $result->clientId); return $result->id; } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testCreateExtensiveCheck($clientId): string { $result = $this->complycube->checks()->create($clientId, $this->check); - $this->assertObjectHasAttribute('id', $result); + $this->assertTrue(property_exists($result, "id")); $this->assertEquals($this->check->type, $result->type); $this->assertEquals($clientId, $result->clientId); return $result->id; } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testCreateStandardCheck($clientId): string { $simpleCheck = $this->check; - $simpleCheck->type = 'standard_screening_check'; + $simpleCheck->type = "standard_screening_check"; $result = $this->complycube->checks()->create($clientId, $simpleCheck); - $this->assertObjectHasAttribute('id', $result); + $this->assertTrue(property_exists($result, "id")); $this->assertEquals($this->check->type, $result->type); $this->assertEquals($clientId, $result->clientId); return $result->id; } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testCreateStandardCheckWithOptions($clientId): string { $simpleCheck = $this->check; - $simpleCheck->type = 'standard_screening_check'; + $simpleCheck->type = "standard_screening_check"; $checkOptions = new CheckOptions(); - $checkOptions->screeningClassification = ['pepLevel1','watchlistSanctionsLists']; + $checkOptions->screeningClassification = [ + "pepLevel1", + "watchlistSanctionsLists", + ]; $result = $this->complycube->checks()->create($clientId, $simpleCheck); - $this->assertObjectHasAttribute('id', $result); + $this->assertTrue(property_exists($result, "id")); $this->assertEquals($this->check->type, $result->type); $this->assertEquals($clientId, $result->clientId); return $result->id; } /** - * @depends testCreatePersonClient - */ - public function testCreateInvalidCheck($clientId): string + * @depends testCreatePersonClient + */ + public function testCreateInvalidCheck($clientId) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $invalidCheck = $this->check; - $invalidCheck->type = 'invaid_check_type'; - $result = $this->complycube->checks()->create($clientId, $invalidCheck); + $invalidCheck->type = "invaid_check_type"; + $this->complycube->checks()->create($clientId, $invalidCheck); } /** - * @depends testCreateStandardCheck - */ - public function testGetCheckById($id) : Check + * @depends testCreateStandardCheck + */ + public function testGetCheckById($id): Check { $result = $this->complycube->checks()->get($id); $this->assertEquals($id, $result->id); @@ -168,68 +192,77 @@ public function testGetCheckById($id) : Check } /** - * @depends testCreatePersonClient - * @depends testCreateDocument - * @depends testCreateAddress - */ - public function testCreatePoACheck($clientId, $documentId, $addressId): string - { - $result = $this->complycube->checks()->create($clientId, ['type' => 'proof_of_address_check', 'documentId' => $documentId, 'addressId' => $addressId]); - $this->assertObjectHasAttribute('id', $result); - $this->assertEquals('proof_of_address_check', $result->type); + * @depends testCreatePersonClient + * @depends testCreateDocument + * @depends testCreateAddress + */ + public function testCreatePoACheck( + $clientId, + $documentId, + $addressId + ): string { + $result = $this->complycube->checks()->create($clientId, [ + "type" => "proof_of_address_check", + "documentId" => $documentId, + "addressId" => $addressId, + ]); + $this->assertTrue(property_exists($result, "id")); + $this->assertEquals("proof_of_address_check", $result->type); $this->assertEquals($clientId, $result->clientId); return $result->id; } /** - * @depends testGetCheckById - */ + * @depends testGetCheckById + */ public function testValidateCheckByIdInline($check) { $check = $this->complycube->checks()->get($check->id); - while ($check->status == 'pending') { + while ($check->status == "pending") { sleep(5); $check = $this->complycube->checks()->get($check->id); } foreach ($check->result->breakdown->matches as $match) { - $result = $this->complycube->checks()->validate( - $check->id, - ['matchId' => $match->id,'outcome' => 'rejected'] - ); - }; - $this->assertEquals('clear', $result->outcome); + $this->complycube->checks()->validate($check->id, [ + "matchId" => $match->id, + "outcome" => "rejected", + ]); + } + $check = $this->complycube->checks()->get($check->id); + $this->assertEquals("clear", $check->result->outcome); } /** - * @depends testGetCheckById - */ + * @depends testGetCheckById + */ public function testValidateCheckById($check) { - $result = $this->complycube->checks()->get($check->id); - while ($result->status == 'pending') { + $check = $this->complycube->checks()->get($check->id); + while ($check->status == "pending") { sleep(5); - $result = $this->complycube->checks()->get($check->id); + $check = $this->complycube->checks()->get($check->id); } - foreach ($result->result->breakdown->matches as $match) { - $validation = new Validation('rejected'); + foreach ($check->result->breakdown->matches as $match) { + $validation = new Validation("rejected"); $validation->matchId = $match->id; - $final = $this->complycube->checks()->validate( - $result->id, - $validation - ); + $this->complycube->checks()->validate($check->id, $validation); } - $this->assertEquals('clear', $final->outcome); + $check = $this->complycube->checks()->get($check->id); + $this->assertEquals("clear", $check->result->outcome); } /** - * @depends testCreateStandardCheck - */ + * @depends testCreateStandardCheck + */ public function testUpdateCheck($id) { $updatedCheck = new Check(); $updatedCheck->enableMonitoring = true; $result = $this->complycube->checks()->update($id, $updatedCheck); - $this->assertEquals($updatedCheck->enableMonitoring, $result->enableMonitoring); + $this->assertEquals( + $updatedCheck->enableMonitoring, + $result->enableMonitoring + ); } public function testListChecks() @@ -239,21 +272,25 @@ public function testListChecks() } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testList2ChecksOnly($clientId) { $this->testCreateStandardCheck($clientId); $this->testCreateStandardCheck($clientId); - $checks = $this->complycube->checks()->list(['page' => 1, 'pageSize' => 2]); + $checks = $this->complycube + ->checks() + ->list(["page" => 1, "pageSize" => 2]); $this->assertEquals(2, iterator_count($checks)); } public function testFilterExtensiveChecksOnly() { - $checks = $this->complycube->checks()->list(['type' => 'extensive_screening_check']); + $checks = $this->complycube + ->checks() + ->list(["type" => "extensive_screening_check"]); foreach ($checks as $chk) { - $this->assertEquals('extensive_screening_check', $chk->type); + $this->assertEquals("extensive_screening_check", $chk->type); } } } diff --git a/tests/integration/ClientTest.php b/tests/integration/ClientTest.php index 62db883..c3fd85c 100644 --- a/tests/integration/ClientTest.php +++ b/tests/integration/ClientTest.php @@ -2,66 +2,75 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; -use ComplyCube\Model\ComplyCubeCollection; -use ComplyCube\Model\PersonDetails; -use ComplyCube\Model\CompanyDetails; +use ComplyCube\Exception\ComplyCubeClientException; use ComplyCube\Model\Client; +use PHPUnit\Framework\TestCase; +use stdClass; /** * @covers \ComplyCube\Resources\ClientApi */ -class ClientTest extends \PHPUnit\Framework\TestCase +class ClientTest extends TestCase { - private $complycube; - private $personClient; - private $companyClient; - + private ?ComplyCubeClient $complycube; + private ?Client $personClient; + private ?Client $companyClient; + protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } - $personDetails = new PersonDetails(); - $personDetails->firstName = 'Jane'; - $personDetails->middleName = 'Middle'; - $personDetails->lastName = 'Smith'; - $personDetails->dob = '1970-01-01'; - $personDetails->gender = 'female'; - $personDetails->nationality = 'GB'; - $personDetails->birthCountry = 'US'; - $personDetails->ssn = '111111111'; - $personDetails->socialInsuranceNumber = 'SI00000000'; - $personDetails->nationalIdentityNumber = 'NI00000000'; - $personDetails->taxIdentificationNumber = 'TIN0000000'; - - $newClient = new Client(); - $newClient->type = 'person'; - $newClient->email = 'john@doe.com'; - $newClient->personDetails = $personDetails; - $this->personClient = $newClient; - - $companyDetails = new CompanyDetails(); - $companyDetails->name = 'Panama Holdings'; - $company = new Client(); - $company->type = 'company'; - $company->email = 'panama@holdings.com'; - $company->companyDetails = $companyDetails; - $this->companyClient = $company; + + $this->personClient = new Client([ + "type" => "person", + "email" => "john@doe.com", + "personDetails" => [ + "firstName" => "Jane", + "middleName" => "Middle", + "lastName" => "Smith", + "dob" => "1970-01-01", + "gender" => "female", + "nationality" => "GB", + "birthCountry" => "US", + "ssn" => "111111111", + "socialInsuranceNumber" => "SI00000000", + "nationalIdentityNumber" => "NI00000000", + "taxIdentificationNumber" => "TIN0000000", + ], + ]); + + $this->companyClient = new Client([ + "type" => "company", + "email" => "panama@holdings.com", + "companyDetails" => [ + "name" => "Panama Holdings", + ], + ]); } public function testCreatePersonInline(): string { - $result = $this->complycube->clients()->create(['type' => 'person', - 'email' => 'john@doe.com', - 'personDetails' => ['firstName' => 'Jane', - 'lastName' => 'Smith', - 'ssn' => '111111111']]); - - $this->assertEquals($this->personClient->personDetails->firstName, $result->personDetails->firstName); - $this->assertEquals($this->personClient->personDetails->lastName, $result->personDetails->lastName); + $result = $this->complycube->clients()->create([ + "type" => "person", + "email" => "john@doe.com", + "personDetails" => [ + "firstName" => "Jane", + "lastName" => "Smith", + "ssn" => "111111111", + ], + ]); + + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); $this->assertEquals($this->personClient->email, $result->email); $this->assertEquals($this->personClient->type, $result->type); return $result->id; @@ -70,8 +79,14 @@ public function testCreatePersonInline(): string public function testCreatePersonClient(): string { $result = $this->complycube->clients()->create($this->personClient); - $this->assertEquals($this->personClient->personDetails->firstName, $result->personDetails->firstName); - $this->assertEquals($this->personClient->personDetails->lastName, $result->personDetails->lastName); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); $this->assertEquals($this->personClient->email, $result->email); $this->assertEquals($this->personClient->type, $result->type); return $result->id; @@ -79,105 +94,391 @@ public function testCreatePersonClient(): string public function testClientMissingEmail() { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $newClient = $this->personClient; - $newClient->email = null; - $result = $this->complycube->clients()->create($newClient); + $this->expectException(ComplyCubeClientException::class); + $this->personClient->email = null; + $this->complycube->clients()->create($this->personClient); } public function testClientMissingType() { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $newClient = $this->personClient; - $newClient->type = null; - $result = $this->complycube->clients()->create($newClient); + $this->expectException(ComplyCubeClientException::class); + $this->personClient->type = null; + $this->complycube->clients()->create($this->personClient); } public function testPersonMissingFirstName() { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $newClient = $this->personClient; - $newClient->personDetails->firstName = null; - $result = $this->complycube->clients()->create($newClient); + $this->expectException(ComplyCubeClientException::class); + $this->personClient->personDetails->firstName = null; + $this->complycube->clients()->create($this->personClient); } public function testPersonMissingLastName() { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $newClient = $this->personClient; - $newClient->personDetails->lastName = null; - $result = $this->complycube->clients()->create($newClient); + $this->expectException(ComplyCubeClientException::class); + $this->personClient->personDetails->lastName = null; + $this->complycube->clients()->create($this->personClient); + } + + public function testCreateCompanyClient(): string + { + $result = $this->complycube->clients()->create($this->companyClient); + $this->assertEquals( + $this->companyClient->companyDetails->name, + $result->companyDetails->name + ); + $this->assertEquals($this->companyClient->email, $result->email); + $this->assertEquals($this->companyClient->type, $result->type); + return $result->id; } - public function testCreateCompanyClient() + public function testCreateCompanyClientWithValidWebsite() { + $this->companyClient->companyDetails->website = + "https://www.google.com"; $result = $this->complycube->clients()->create($this->companyClient); - $this->assertEquals($this->companyClient->companyDetails->name, $result->companyDetails->name); + $this->assertEquals( + $this->companyClient->companyDetails->name, + $result->companyDetails->name + ); + $this->assertEquals( + $this->companyClient->companyDetails->website, + $result->companyDetails->website + ); $this->assertEquals($this->companyClient->email, $result->email); $this->assertEquals($this->companyClient->type, $result->type); } - + + /** + * @depends testCreateCompanyClient + */ + public function testUpdateCompanyClientWithValidWebsite($id) + { + $result = $this->complycube->clients()->update($id, [ + "companyDetails" => ["website" => "https://www.google.com"], + ]); + + $this->assertEquals( + $this->companyClient->companyDetails->name, + $result->companyDetails->name + ); + $this->assertEquals( + "https://www.google.com", + $result->companyDetails->website + ); + $this->assertEquals($this->companyClient->email, $result->email); + $this->assertEquals($result->type, "company"); + } + + public function testCreateClientWithValidMetadata() + { + $this->personClient->metadata = (object) [ + "key1" => "value1", + "key2" => "value2", + "key3" => "value3", + ]; + + $result = $this->complycube->clients()->create($this->personClient); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); + $this->assertEquals($this->personClient->email, $result->email); + $this->assertEquals($this->personClient->type, $result->type); + $this->assertEquals($this->personClient->metadata, $result->metadata); + } + public function testCreateClientWithValidMetadataInline() + { + $this->personClient->metadata = [ + "key1" => "value1", + "key2" => "value2", + "key3" => "value3", + ]; + + $result = $this->complycube->clients()->create($this->personClient); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); + $this->assertEquals($this->personClient->email, $result->email); + $this->assertEquals($this->personClient->type, $result->type); + $this->assertEquals( + (object) $this->personClient->metadata, + $result->metadata + ); + } + + public function testCreateClientWithMetadataContainingNonStringKeys() + { + $this->expectException(ComplyCubeClientException::class); + $this->personClient->metadata = ["value1", "value2", "value3"]; + $this->complycube->clients()->create($this->personClient); + } + public function testCreateClientWithMetadataContainingNonStringValues() + { + $this->expectException(ComplyCubeClientException::class); + $this->personClient->metadata = [ + "key1" => 1, + "key2" => 1.5, + "key3" => true, + "key4" => null, + "key5" => [1, 2, 3], + "key6" => [ + "a" => 1, + "b" => 2, + "c" => 3, + ], + "key7" => (function () { + $obj = new stdClass(); + $obj->a = 1; + $obj->b = 2; + $obj->c = 3; + return $obj; + })(), + ]; + $this->complycube->clients()->create($this->personClient); + } + public function testCreateClientWithMetadataContainingInvalidLengthKeys() + { + $this->expectException(ComplyCubeClientException::class); + $this->personClient->metadata = [ + str_repeat("key1", 11) => "value1", + "key2" => "value2", + "key3" => "value3", + ]; + $this->complycube->clients()->create($this->personClient); + } + public function testCreateClientWithMetadataContainingInvalidLengthValues() + { + $this->expectException(ComplyCubeClientException::class); + $this->personClient->metadata = [ + "key1" => str_repeat("value1", 84), + "key2" => "value2", + "key3" => "value3", + ]; + $this->complycube->clients()->create($this->personClient); + } + public function testCreateClientWithMetadataEntriesExceedingCountLimit() + { + $this->expectException(ComplyCubeClientException::class); + for ($i = 0; $i < 21; $i++) { + $this->personClient->metadata["$i"] = "$i"; + } + $this->complycube->clients()->create($this->personClient); + } + + /** + * @depends testCreatePersonClient + */ + public function testUpdateClientWithValidMetadata($id) + { + $metadata = (object) [ + "key1" => "value1", + "key2" => "value2", + "key3" => "value3", + ]; + + $result = $this->complycube->clients()->update($id, [ + "metadata" => $metadata, + ]); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); + $this->assertEquals($this->personClient->email, $result->email); + $this->assertEquals($result->type, "person"); + $this->assertEquals($metadata, $result->metadata); + } + + /** + * @depends testCreatePersonClient + */ + public function testUpdateClientWithValidMetadataInline($id) + { + $metadata = [ + "key1" => "value1", + "key2" => "value2", + "key3" => "value3", + ]; + + $result = $this->complycube->clients()->update($id, $metadata); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); + $this->assertEquals($this->personClient->email, $result->email); + $this->assertEquals($result->type, "person"); + $this->assertEquals((object) $metadata, $result->metadata); + } + + /** + * @depends testCreatePersonClient + */ + public function testUpdateClientWithMetadataContainingNonStringKeys($id) + { + $this->expectException(ComplyCubeClientException::class); + $this->complycube->clients()->update($id, [ + "metadata" => ["value1", "value2", "value3"], + ]); + } + + /** + * @depends testCreatePersonClient + */ + public function testUpdateClientWithMetadataContainingNonStringValues($id) + { + $this->expectException(ComplyCubeClientException::class); + $this->complycube->clients()->update($id, [ + "metadata" => [ + "key1" => 1, + "key2" => 1.5, + "key3" => true, + "key4" => null, + "key5" => [1, 2, 3], + "key6" => [ + "a" => 1, + "b" => 2, + "c" => 3, + ], + "key7" => (object) ["a" => 1, "b" => 2, "c" => 3], + ], + ]); + } + + /** + * @depends testCreatePersonClient + */ + public function testUpdateClientWithMetadataContainingInvalidLengthKeys($id) + { + $this->expectException(ComplyCubeClientException::class); + $this->complycube->clients()->update($id, [ + "metadata" => [ + str_repeat("key1", 11) => "value1", + "key2" => "value2", + "key3" => "value3", + ], + ]); + } + + /** + * @depends testCreatePersonClient + */ + public function testUpdateClientWithMetadataContainingInvalidLengthValues( + $id + ) { + $this->expectException(ComplyCubeClientException::class); + $this->complycube->clients()->update($id, [ + "metadata" => [ + "key1" => str_repeat("value1", 84), + "key2" => "value2", + "key3" => "value3", + ], + ]); + } + + /** + * @depends testCreatePersonClient + */ + public function testUpdateClientWithMetadataEntriesExceedingCountLimit($id) + { + $this->expectException(ComplyCubeClientException::class); + + $metadata = []; + + for ($i = 0; $i < 21; $i++) { + $metadata["$i"] = "$i"; + } + + $this->complycube->clients()->update($id, [ + "metadata" => $metadata, + ]); + } + public function testGetNonExistentPersonById() { try { - $retrievedClient = $this->complycube->clients()->get('nonexistentclientid'); - } catch (\ComplyCube\Exception\ComplyCubeClientException $e) { + $this->complycube->clients()->get("nonexistentclientid"); + } catch (ComplyCubeClientException $e) { $this->assertEquals($e->getCode(), 404); } } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testGetPersonById($id) { $retrievedClient = $this->complycube->clients()->get($id); - $this->assertEquals($this->personClient->personDetails->firstName, $retrievedClient->personDetails->firstName); - $this->assertEquals($this->personClient->personDetails->lastName, $retrievedClient->personDetails->lastName); - $this->assertEquals($this->personClient->email, $retrievedClient->email); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $retrievedClient->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $retrievedClient->personDetails->lastName + ); + $this->assertEquals( + $this->personClient->email, + $retrievedClient->email + ); $this->assertEquals($this->personClient->type, $retrievedClient->type); } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testUpdatePerson($id) { - $clientUpdate = new Client(); - $clientUpdate->email = 'updated@email.com'; - $updatedClient = $this->complycube->clients()->update($id, $clientUpdate); + $updatedClient = $this->complycube->clients()->update($id, [ + "email" => "updated@email.com", + ]); $retrievedClient = $this->complycube->clients()->get($id); - $this->assertEquals($clientUpdate->email, $retrievedClient->email); + $this->assertEquals($updatedClient->email, $retrievedClient->email); } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testUpdatePersonWithUselessInformation($id) { - $clientUpdate = new Client(); - $clientUpdate->email = 'adifferent@email.com'; - $companyDetails = new CompanyDetails(); - $companyDetails->website = 'http://awebsite.com'; - $clientUpdate->companyDetails = $companyDetails; - $updatedClient = $this->complycube->clients()->update($id, $clientUpdate); - $this->assertEquals($clientUpdate->email, $updatedClient->email); + $updatedClient = $this->complycube->clients()->update($id, [ + "email" => "adifferent@email.com", + "companyDetails" => [ + "website" => "http://awebsite.com", + ], + ]); + $this->assertEquals("adifferent@email.com", $updatedClient->email); } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testDeletePerson($id) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $this->complycube->clients()->delete($id); $this->complycube->clients()->get($id); } - /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testListPersons() { $clients = $this->complycube->clients()->list(); @@ -185,19 +486,21 @@ public function testListPersons() } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testList2PersonsOnly() { - $clients = $this->complycube->clients()->list(['page' => 1, 'pageSize' => 2]); + $clients = $this->complycube + ->clients() + ->list(["page" => 1, "pageSize" => 2]); $this->assertEquals(2, iterator_count($clients)); } public function testFilterCompaniesOnly() { - $clients = $this->complycube->clients()->list(['type' => 'company']); + $clients = $this->complycube->clients()->list(["type" => "company"]); foreach ($clients as $client) { - $this->assertEquals('company', $client->type); + $this->assertEquals("company", $client->type); } } } diff --git a/tests/integration/CompanyTest.php b/tests/integration/CompanyTest.php new file mode 100644 index 0000000..3b654d4 --- /dev/null +++ b/tests/integration/CompanyTest.php @@ -0,0 +1,204 @@ +complycube)) { + $apiKey = getenv("CC_API_KEY"); + $this->complycube = new ComplyCubeClient($apiKey); + } + } + + public function testSearchCompany(): void + { + $result = $this->complycube->companies()->search([ + "companyName" => "CLEDARA", + "incorporationCountry" => "GB", + ]); + + $this->assertInstanceOf(ComplyCubeCollection::class, $result); + + $this->assertCount(2, $result); + + foreach ($result->items as $item) { + $this->assertInstanceOf(CompanyDetails::class, $item); + + foreach ( + [ + "id", + "name", + "registrationNumber", + "incorporationCountry", + "incorporationDate", + "incorporationType", + "address", + "active", + "sourceUrl", + ] + as $key + ) { + $this->assertNotNull($item->$key); + } + + foreach (["line", "city", "postalCode", "country"] as $key) { + $this->assertNotNull($item->address->$key); + } + + foreach (["createdAt", "updatedAt"] as $property_name) { + $item_reflection_property = new ReflectionProperty( + $item, + $property_name + ); + + $address_reflection_property = new ReflectionProperty( + $item->address, + $property_name + ); + + $item_reflection_property->setAccessible(true); + $address_reflection_property->setAccessible(true); + + $this->assertNotNull( + $item_reflection_property->getValue($item) + ); + + $this->assertNull( + $address_reflection_property->getValue($item->address) + ); + } + + foreach ( + ["owners", "officers", "filings", "industryCodes", "website"] + as $key + ) { + $this->assertNull($item->$key); + } + } + } + + public function testSearchCompanyWithInvalidParameters(): void + { + $this->expectException(ComplyCubeClientException::class); + $this->complycube->companies()->search([ + "param_1" => "CLEDARA", + "param_2" => "GB", + ]); + } + + public function testGetCompanyDetails(): void + { + $result = $this->complycube + ->companies() + ->get("67625f5f3131343535333733"); + + $this->assertInstanceOf(CompanyDetails::class, $result); + + foreach ( + [ + "id", + "name", + "registrationNumber", + "incorporationCountry", + "incorporationDate", + "incorporationType", + "address", + "active", + "sourceUrl", + "owners", + "officers", + "filings", + "industryCodes", + ] + as $key + ) { + $this->assertNotNull($result->$key); + } + + foreach (["line", "city", "postalCode", "country"] as $key) { + $this->assertNotNull($result->address->$key); + } + + foreach ( + [ + "owners" => [ + "type", + "role", + "entityType", + "entityName", + "ownershipType", + "firstName", + "lastName", + "dob", + "nationality", + "countryOfResidence", + "address", + "ownershipStructure", + ], + "officers" => [ + "entityName", + "role", + "occupation", + "nationality", + "firstName", + "lastName", + "active", + ], + "filings" => ["name", "description", "type", "date", "fileUrl"], + "industryCodes" => ["code", "description", "scheme"], + ] + as $key => $value + ) { + foreach ($result->$key as $item) { + foreach ($value as $attribute) { + $this->assertTrue(isset($item->$attribute)); + } + } + } + + foreach (["createdAt", "updatedAt"] as $property_name) { + $result_reflection_property = new ReflectionProperty( + $result, + $property_name + ); + + $address_reflection_property = new ReflectionProperty( + $result->address, + $property_name + ); + + $result_reflection_property->setAccessible(true); + $address_reflection_property->setAccessible(true); + + $this->assertNotNull( + $result_reflection_property->getValue($result) + ); + + $this->assertNull( + $address_reflection_property->getValue($result->address) + ); + } + + $this->assertNull($result->website); + } + + public function testGetNonExistentCompanyDetails(): void + { + $this->expectException(ComplyCubeClientException::class); + $this->complycube->companies()->get("non existent company id"); + } +} diff --git a/tests/integration/CustomListTest.php b/tests/integration/CustomListTest.php new file mode 100644 index 0000000..e1fe4ae --- /dev/null +++ b/tests/integration/CustomListTest.php @@ -0,0 +1,228 @@ +complycube)) { + $apiKey = getenv("CC_API_KEY"); + $this->complycube = new ComplyCubeClient($apiKey); + } + + $this->personEntity = [ + "entityType" => "person", + "names" => [ + [ + "type" => "primary", + "firstName" => "John", + "lastName" => "Smith", + ], + [ + "type" => "alias", + "firstName" => "John", + "lastName" => "Smyth", + ], + ], + "active" => true, + "gender" => "male", + "countries" => [ + [ + "type" => "Jurisdiction", + "country" => "US", + ], + [ + "type" => "Resident of", + "country" => "GB", + ], + ], + "dates" => [ + [ + "type" => "Date of Birth", + "date" => [ + "day" => "01", + "month" => "01", + "year" => "1987", + ], + ], + ], + "images" => ["https://www.example.com/johnDoe.jpg"], + ]; + + $this->companyEntity = [ + "entityType" => "company", + "names" => [ + [ + "type" => "primary", + "companyName" => "Company A", + ], + [ + "type" => "alias", + "companyName" => "Company 1", + ], + ], + "active" => true, + "countries" => [ + [ + "type" => "Jurisdiction", + "country" => "US", + ], + [ + "type" => "Resident of", + "country" => "GB", + ], + ], + "dates" => [ + [ + "type" => "Date of Registration", + "date" => [ + "day" => "01", + "month" => "01", + "year" => "1987", + ], + ], + ], + "images" => ["https://www.example.com/johnDoe.jpg"], + ]; + } + + private function custom_list_assertions($item) + { + $this->assertInstanceOf(CustomList::class, $item); + + foreach (["id", "name", "stats"] as $key) { + $this->assertNotNull($item->$key); + } + + foreach (["personCount", "companyCount"] as $key) { + $this->assertNotNull($item->stats->$key); + } + + foreach (["createdAt", "updatedAt", "lastActionBy"] as $property_name) { + $item_reflection_property = new ReflectionProperty( + $item, + $property_name + ); + + $item_reflection_property->setAccessible(true); + + $this->assertNotNull($item_reflection_property->getValue($item)); + } + + $this->assertNull($item->description); + } + + /** + * @group live + */ + public function testGetNonExistentCustomList() + { + $this->expectException(ComplyCubeClientException::class); + $this->complycube->customLists()->get("non existent list id"); + } + + /** + * @group live + */ + public function testGetCustomList(): string + { + $result = $this->complycube + ->customLists() + ->get("6286d8c68934e300099ee74f"); + + $this->custom_list_assertions($result); + + return $result->id; + } + + /** + * @group live + * @depends testGetCustomList + */ + public function testAddPersonEntityToCustomList($id) + { + $result = $this->complycube->customLists()->get($id); + + $this->complycube->customLists()->add($id, $this->personEntity); + + $this->assertEquals( + $result->stats->personCount + 1, + $this->complycube->customLists()->get($id)->stats->personCount + ); + } + + /** + * @group live + * @depends testGetCustomList + */ + public function testAddInvalidPersonEntityToCustomList($id) + { + $this->expectException(ComplyCubeClientException::class); + + unset($this->personEntity["names"]); + + $this->complycube->customLists()->add($id, $this->personEntity); + } + + /** + * @group live + * @depends testGetCustomList + */ + public function testAddCompanyEntityToCustomList($id) + { + $result = $this->complycube->customLists()->get($id); + + $this->complycube->customLists()->add($id, $this->companyEntity); + + $this->assertEquals( + $result->stats->companyCount + 1, + $this->complycube->customLists()->get($id)->stats->companyCount + ); + } + + /** + * @group live + * @depends testGetCustomList + */ + public function testAddInvalidCompanyEntityToCustomList($id) + { + $this->expectException(ComplyCubeClientException::class); + + unset($this->companyEntity["names"]); + + $this->complycube->customLists()->add($id, $this->companyEntity); + } + + /** + * @group live + */ + + public function testListCustomLists() + { + $result = $this->complycube->customLists()->list(); + + $this->assertInstanceOf(ComplyCubeCollection::class, $result); + + $this->assertCount(1, $result); + + foreach ($result->items as $item) { + $this->custom_list_assertions($item); + } + } +} diff --git a/tests/integration/DocumentTest.php b/tests/integration/DocumentTest.php index 8e970e0..50569ee 100644 --- a/tests/integration/DocumentTest.php +++ b/tests/integration/DocumentTest.php @@ -2,37 +2,38 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; -use ComplyCube\Model\Image; +use ComplyCube\Exception\ComplyCubeClientException; use ComplyCube\Model\Client; -use ComplyCube\Model\PersonDetails; use ComplyCube\Model\Document; +use ComplyCube\Model\Image; +use ComplyCube\Model\PersonDetails; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\Resources\DocumentApi */ -class DocumentTest extends \PHPUnit\Framework\TestCase +class DocumentTest extends TestCase { - private $complycube; - private $document; - private $personClient; + private ?ComplyCubeClient $complycube; + private ?Client $personClient; + private ?Document $document; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } $document = new Document(); - $document->type = 'passport'; + $document->type = "passport"; $this->document = $document; $personDetails = new PersonDetails(); - $personDetails->firstName = 'Richard'; - $personDetails->lastName = 'Nixon'; + $personDetails->firstName = "Richard"; + $personDetails->lastName = "Nixon"; $newClient = new Client(); - $newClient->type = 'person'; - $newClient->email = 'john@doe.com'; + $newClient->type = "person"; + $newClient->email = "john@doe.com"; $newClient->personDetails = $personDetails; $this->personClient = $newClient; } @@ -40,16 +41,22 @@ protected function setUp(): void public function testCreatePersonForDocument(): string { $result = $this->complycube->clients()->create($this->personClient); - $this->assertEquals($this->personClient->personDetails->firstName, $result->personDetails->firstName); - $this->assertEquals($this->personClient->personDetails->lastName, $result->personDetails->lastName); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); $this->assertEquals($this->personClient->email, $result->email); $this->assertEquals($this->personClient->type, $result->type); return $result->id; } /** - * @depends testCreatePersonForDocument - */ + * @depends testCreatePersonForDocument + */ public function testCreateDocument($clientId): Document { $adoc = $this->document; @@ -60,29 +67,41 @@ public function testCreateDocument($clientId): Document } /** - * @depends testCreatePersonForDocument - */ + * @depends testCreatePersonForDocument + */ + public function testCreateDocumentInline($clientId) + { + $adoc = $this->document->jsonSerialize(); + $result = $this->complycube->documents()->create($clientId, $adoc); + $this->assertIsArray($adoc); + $this->assertEquals($adoc["type"], $result->type); + $this->assertEquals($clientId, $result->clientId); + } + + /** + * @depends testCreatePersonForDocument + */ public function testCreateDocumentWithMissingType($clientId) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $doc = new Document(); - $result = $this->complycube->documents()->create($clientId, $doc); + $this->complycube->documents()->create($clientId, $doc); } /** - * @depends testCreatePersonForDocument - */ + * @depends testCreatePersonForDocument + */ public function testCreateDocumentWithInvalidType($clientId) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $doc = new Document(); - $doc->type = 'INVALIDTYPE'; - $result = $this->complycube->documents()->create($clientId, $doc); + $doc->type = "INVALIDTYPE"; + $this->complycube->documents()->create($clientId, $doc); } /** - * @depends testCreateDocument - */ + * @depends testCreateDocument + */ public function testGetDocument($document) { $retrievedDoc = $this->complycube->documents()->get($document->id); @@ -92,177 +111,203 @@ public function testGetDocument($document) public function testGetNonExistentDocument() { try { - $retrievedClient = $this->complycube->documents()->get('nonexistentid'); - } catch (\ComplyCube\Exception\ComplyCubeClientException $e) { + $this->complycube->documents()->get("nonexistentid"); + } catch (ComplyCubeClientException $e) { $this->assertEquals($e->getCode(), 404); } } /** - * @depends testCreateDocument - */ + * @depends testCreateDocument + */ public function testUpdateDocumentType($document) { $doc = new Document(); - $doc->type = 'driving_license'; + $doc->type = "driving_license"; $result = $this->complycube->documents()->update($document->id, $doc); $this->assertEquals($result->type, $doc->type); } /** - * @depends testCreateDocument - */ + * @depends testCreateDocument + */ public function testUpdateDocumentInvalidType($document) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $doc = new Document(); - $doc->type = 'INVALIDTYPE'; + $doc->type = "INVALIDTYPE"; $result = $this->complycube->documents()->update($document->id, $doc); $this->assertEquals($result->type, $doc->type); } /** - * @depends testCreateDocument - */ + * @depends testCreateDocument + */ public function testUploadImageToDocument($document): Image { $image = new Image(); - $image->fileName = 'front.jpg'; - $image->data = file_get_contents("./tests/fixtures/encoded-20200609153459.txt", "r"); - $result = $this->complycube->documents()->upload($document->id, 'front', $image); + $image->fileName = "front.jpg"; + $image->data = file_get_contents( + "./tests/fixtures/encoded-20200609153459.txt" + ); + $result = $this->complycube + ->documents() + ->upload($document->id, "front", $image); $this->assertEquals($image->fileName, $result->fileName); - $this->assertEquals('front', $result->documentSide); - $this->assertEquals('image/jpg', $result->contentType); + $this->assertEquals("front", $result->documentSide); + $this->assertEquals("image/jpg", $result->contentType); return $result; } /** - * @depends testCreateDocument - */ + * @depends testCreateDocument + */ public function testUploadImageToDocumentInline($document): Image { - $result = $this->complycube->documents()->upload( - $document->id, - 'back', - ['fileName' => 'back.jpg', - 'data' => file_get_contents("./tests/fixtures/encoded-20200609153459.txt", "r")] - ); - $this->assertEquals('back.jpg', $result->fileName); - $this->assertEquals('back', $result->documentSide); - $this->assertEquals('image/jpg', $result->contentType); + $result = $this->complycube + ->documents() + ->upload($document->id, "back", [ + "fileName" => "back.jpg", + "data" => file_get_contents( + "./tests/fixtures/encoded-20200609153459.txt" + ), + ]); + $this->assertEquals("back.jpg", $result->fileName); + $this->assertEquals("back", $result->documentSide); + $this->assertEquals("image/jpg", $result->contentType); return $result; } /** - * @depends testCreateDocument - */ + * @depends testCreateDocument + */ public function testUploadImageToDocumentInvalidSide($document) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $image = new Image(); - $image->fileName = 'front.jpg'; - $image->data = file_get_contents("./tests/fixtures/encoded-20200609153459.txt", "r"); - $result = $this->complycube->documents()->upload($document->id, 'INVALIDSIDE', $image); + $image->fileName = "front.jpg"; + $image->data = file_get_contents( + "./tests/fixtures/encoded-20200609153459.txt" + ); + $this->complycube + ->documents() + ->upload($document->id, "INVALIDSIDE", $image); } /** - * @depends testCreateDocument - */ + * @depends testCreateDocument + */ public function testUploadImageToDocumentNoFilename($document) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $image = new Image(); - $image->data = file_get_contents("./tests/fixtures/encoded-20200609153459.txt", "r"); - $result = $this->complycube->documents()->upload($document->id, 'front', $image); + $image->data = file_get_contents( + "./tests/fixtures/encoded-20200609153459.txt" + ); + $this->complycube->documents()->upload($document->id, "front", $image); } /** - * @depends testCreateDocument - */ + * @depends testCreateDocument + */ public function testUploadImageToDocumentNoData($document) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $image = new Image(); - $image->fileName = 'front.jpg'; - $result = $this->complycube->documents()->upload($document->id, 'front', $image); + $image->fileName = "front.jpg"; + $this->complycube->documents()->upload($document->id, "front", $image); } /** - * @depends testCreateDocument - */ + * @depends testCreateDocument + */ public function testDownloadImageFromDocument($document) { - $download = $this->complycube->documents()->download($document->id, 'front'); - $this->assertEquals('front.jpg', $download->fileName); + $download = $this->complycube + ->documents() + ->download($document->id, "front"); + $this->assertEquals("front.jpg", $download->fileName); } /** - * @depends testCreateDocument - */ + * @depends testCreateDocument + */ public function testDownloadImageFromDocumentInvalidSide($document) { - $download = $this->complycube->documents()->download($document->id, 'INVALIDSIDE'); - $this->assertEquals('front.jpg', $download->fileName); + $download = $this->complycube + ->documents() + ->download($document->id, "INVALIDSIDE"); + $this->assertEquals("front.jpg", $download->fileName); } public function testDownloadImageFromDocumentNonExistentId() { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $download = $this->complycube->documents()->download('nonexistentid', 'INVALIDSIDE'); + $this->expectException(ComplyCubeClientException::class); + $this->complycube + ->documents() + ->download("nonexistentid", "INVALIDSIDE"); } /** - * @depends testCreateDocument - * @depends testUploadImageToDocument - */ + * @depends testCreateDocument + * @depends testUploadImageToDocument + */ public function testDeleteImageFromDocument($document, $img) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $this->complycube->documents()->deleteImage($document->id, $img->documentSide); - $this->complycube->documents()->download($document->id, $img->documentSide); + $this->expectException(ComplyCubeClientException::class); + $this->complycube + ->documents() + ->deleteImage($document->id, $img->documentSide); + $this->complycube + ->documents() + ->download($document->id, $img->documentSide); } public function testDeleteImageNonExistentImage() { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $this->complycube->documents()->deleteImage('nonexistentid', 'front'); + $this->expectException(ComplyCubeClientException::class); + $this->complycube->documents()->deleteImage("nonexistentid", "front"); } public function testDeleteNonExistentDocument() { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $this->complycube->documents()->delete('nonexistentid'); + $this->expectException(ComplyCubeClientException::class); + $this->complycube->documents()->delete("nonexistentid"); } /** - * @depends testCreatePersonForDocument - */ + * @depends testCreatePersonForDocument + */ public function testListDocuments($clientId) { $documents = $this->complycube->documents()->list($clientId); - $this->assertGreaterThan(0, $documents ->totalItems); + $this->assertGreaterThan(0, $documents->totalItems); } /** - * @depends testCreatePersonForDocument - */ + * @depends testCreatePersonForDocument + */ public function testList2DocumentsOnly($clientId) { $this->testCreateDocument($clientId); $this->testCreateDocument($clientId); - $documents = $this->complycube->documents()->list($clientId, ['page' => 1, 'pageSize' => 2]); + $documents = $this->complycube + ->documents() + ->list($clientId, ["page" => 1, "pageSize" => 2]); $this->assertEquals(2, iterator_count($documents)); } /** - * @depends testCreatePersonForDocument - */ + * @depends testCreatePersonForDocument + */ public function testFilterPassportDocumentsOnly($clientId) { $this->testCreateDocument($clientId); - $documents = $this->complycube->documents()->list($clientId, ['type' => 'passport']); + $documents = $this->complycube + ->documents() + ->list($clientId, ["type" => "passport"]); foreach ($documents as $doc) { - $this->assertEquals('passport', $doc->type); + $this->assertEquals("passport", $doc->type); } } } diff --git a/tests/integration/FlowSessionTest.php b/tests/integration/FlowSessionTest.php index 7885584..7325784 100644 --- a/tests/integration/FlowSessionTest.php +++ b/tests/integration/FlowSessionTest.php @@ -2,55 +2,61 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; -use ComplyCube\Model\PersonDetails; -use ComplyCube\Model\FlowSession; use ComplyCube\Model\Client; +use ComplyCube\Model\FlowSession; +use ComplyCube\Model\PersonDetails; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\Resources\FlowSessionApi */ -class FlowSessionTest extends \PHPUnit\Framework\TestCase +class FlowSessionTest extends TestCase { - private $complycube; - private $personClient; - private $fs; + private ?ComplyCubeClient $complycube; + private ?Client $personClient; + private ?FlowSession $fs; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } $personDetails = new PersonDetails(); - $personDetails->firstName = 'Richard'; - $personDetails->lastName = 'Nixon'; + $personDetails->firstName = "Richard"; + $personDetails->lastName = "Nixon"; $newClient = new Client(); - $newClient->type = 'person'; - $newClient->email = 'john@doe.com'; + $newClient->type = "person"; + $newClient->email = "john@doe.com"; $newClient->personDetails = $personDetails; $this->personClient = $newClient; $this->fs = new FlowSession(); - $this->fs->checkTypes = ['extensive_screening_check']; - $this->fs->successUrl = 'https://complycube.com'; - $this->fs->cancelUrl = 'https://complycube.com'; + $this->fs->checkTypes = ["extensive_screening_check"]; + $this->fs->successUrl = "https://complycube.com"; + $this->fs->cancelUrl = "https://complycube.com"; } public function testCreatePersonForSession(): string { $result = $this->complycube->clients()->create($this->personClient); - $this->assertEquals($this->personClient->personDetails->firstName, $result->personDetails->firstName); - $this->assertEquals($this->personClient->personDetails->lastName, $result->personDetails->lastName); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); $this->assertEquals($this->personClient->email, $result->email); $this->assertEquals($this->personClient->type, $result->type); return $result->id; } /** - * @depends testCreatePersonForSession - */ + * @depends testCreatePersonForSession + */ public function testCreateFlowSession($clientId) { $flowSession = $this->fs; @@ -60,14 +66,16 @@ public function testCreateFlowSession($clientId) } /** - * @depends testCreatePersonForSession - */ + * @depends testCreatePersonForSession + */ public function testCreateFlowSessionInline($clientId) { - $result = $this->complycube->flow()->createSession(['clientId' => $clientId, - 'checkTypes' => $this->fs->checkTypes, - 'successUrl' => $this->fs->successUrl, - 'cancelUrl' => $this->fs->cancelUrl]); + $result = $this->complycube->flow()->createSession([ + "clientId" => $clientId, + "checkTypes" => $this->fs->checkTypes, + "successUrl" => $this->fs->successUrl, + "cancelUrl" => $this->fs->cancelUrl, + ]); $this->assertNotNull($result->redirectUrl); } } diff --git a/tests/integration/LivePhotoTest.php b/tests/integration/LivePhotoTest.php index af8e1be..7061231 100644 --- a/tests/integration/LivePhotoTest.php +++ b/tests/integration/LivePhotoTest.php @@ -2,33 +2,33 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; -use ComplyCube\Model\PersonDetails; -use ComplyCube\Model\Image; +use ComplyCube\Exception\ComplyCubeClientException; use ComplyCube\Model\Client; +use ComplyCube\Model\Image; +use ComplyCube\Model\PersonDetails; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\Resources\LivePhotoApi */ -class LivePhotoTest extends \PHPUnit\Framework\TestCase +class LivePhotoTest extends TestCase { - private $complycube; - private $document; - private $personClient; + private ?ComplyCubeClient $complycube; + private ?Client $personClient; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } $personDetails = new PersonDetails(); - $personDetails->firstName = 'Richard'; - $personDetails->lastName = 'Nixon'; + $personDetails->firstName = "Richard"; + $personDetails->lastName = "Nixon"; $newClient = new Client(); - $newClient->type = 'person'; - $newClient->email = 'john@doe.com'; + $newClient->type = "person"; + $newClient->email = "john@doe.com"; $newClient->personDetails = $personDetails; $this->personClient = $newClient; } @@ -36,51 +36,64 @@ protected function setUp(): void public function testCreatePersonForDocument(): string { $result = $this->complycube->clients()->create($this->personClient); - $this->assertEquals($this->personClient->personDetails->firstName, $result->personDetails->firstName); - $this->assertEquals($this->personClient->personDetails->lastName, $result->personDetails->lastName); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); $this->assertEquals($this->personClient->email, $result->email); $this->assertEquals($this->personClient->type, $result->type); return $result->id; } /** - * @depends testCreatePersonForDocument - */ + * @depends testCreatePersonForDocument + */ public function testUploadLivePhoto($clientId): string { $image = new Image(); - $image->data = file_get_contents("./tests/fixtures/encoded-20200609153459.txt", "r"); + $image->data = file_get_contents( + "./tests/fixtures/encoded-20200609153459.txt" + ); $image->performLivenessCheck = false; $result = $this->complycube->livephotos()->upload($clientId, $image); $this->assertEquals($clientId, $result->clientId); $this->assertEquals(false, $result->performLivenessCheck); return $result->id; } - + /** - * @depends testCreatePersonForDocument - */ + * @depends testCreatePersonForDocument + */ public function testUploadLivePhotoInline($clientId): string { - $image = file_get_contents("./tests/fixtures/encoded-20200609153459.txt", "r"); - $result = $this->complycube->livephotos()->upload($clientId, ['data' => $image, 'performLivenessCheck' => false]); + $image = file_get_contents( + "./tests/fixtures/encoded-20200609153459.txt" + ); + $result = $this->complycube->livephotos()->upload($clientId, [ + "data" => $image, + "performLivenessCheck" => false, + ]); $this->assertEquals($clientId, $result->clientId); $this->assertEquals(false, $result->performLivenessCheck); return $result->id; } /** - * @depends testUploadLivePhoto - */ + * @depends testUploadLivePhoto + */ public function testDownloadLivePhoto($livePhotoId) { $img = $this->complycube->livephotos()->download($livePhotoId); - $this->assertEquals('images/jpg', $img->contentType); + $this->assertEquals("images/jpg", $img->contentType); } /** - * @depends testCreatePersonForDocument - */ + * @depends testCreatePersonForDocument + */ public function testListLivePhotos($clientId) { $this->testUploadLivePhoto($clientId); @@ -89,22 +102,24 @@ public function testListLivePhotos($clientId) } /** - * @depends testCreatePersonForDocument - */ + * @depends testCreatePersonForDocument + */ public function testList2LivePhotosOnly($clientId) { $this->testUploadLivePhoto($clientId); $this->testUploadLivePhoto($clientId); - $photos = $this->complycube->livephotos()->list($clientId, ['page' => 1, 'pageSize' => 2]); + $photos = $this->complycube + ->livephotos() + ->list($clientId, ["page" => 1, "pageSize" => 2]); $this->assertEquals(2, iterator_count($photos)); } /** - * @depends testUploadLivePhoto - */ + * @depends testUploadLivePhoto + */ public function testDeleteLivePhoto($livePhotoId) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $this->complycube->livephotos()->delete($livePhotoId); $this->complycube->livephotos()->get($livePhotoId); } diff --git a/tests/integration/LiveVideoTest.php b/tests/integration/LiveVideoTest.php index 55eaf78..a1f2fd3 100644 --- a/tests/integration/LiveVideoTest.php +++ b/tests/integration/LiveVideoTest.php @@ -2,31 +2,33 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; -use ComplyCube\Model\PersonDetails; -use ComplyCube\Model\LiveVideo; +use ComplyCube\Exception\ComplyCubeClientException; use ComplyCube\Model\Client; +use ComplyCube\Model\LiveVideo; +use ComplyCube\Model\PersonDetails; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\Resources\LiveVideoApi */ -class LiveVideoTest extends \PHPUnit\Framework\TestCase +class LiveVideoTest extends TestCase { - private $complycube; + private ?ComplyCubeClient $complycube; + private ?Client $personClient; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } $personDetails = new PersonDetails(); - $personDetails->firstName = 'John'; - $personDetails->lastName = 'Doe'; + $personDetails->firstName = "John"; + $personDetails->lastName = "Doe"; $newClient = new Client(); - $newClient->type = 'person'; - $newClient->email = 'john@doe.com'; + $newClient->type = "person"; + $newClient->email = "john@doe.com"; $newClient->personDetails = $personDetails; $this->personClient = $newClient; } @@ -34,19 +36,29 @@ protected function setUp(): void public function testCreatePersonForVideo(): string { $result = $this->complycube->clients()->create($this->personClient); - $this->assertEquals($this->personClient->personDetails->firstName, $result->personDetails->firstName); - $this->assertEquals($this->personClient->personDetails->lastName, $result->personDetails->lastName); + $this->assertEquals( + $this->personClient->personDetails->firstName, + $result->personDetails->firstName + ); + $this->assertEquals( + $this->personClient->personDetails->lastName, + $result->personDetails->lastName + ); $this->assertEquals($this->personClient->email, $result->email); $this->assertEquals($this->personClient->type, $result->type); return $result->id; } /** - * @depends testCreatePersonForVideo - */ + * @depends testCreatePersonForVideo + */ public function testCreateLiveVideo($clientId): string { - $response = $this->complycube->apiClient->post('liveVideos',[], ['clientId' => $clientId]); + $response = $this->complycube->apiClient->post( + "liveVideos", + [], + ["clientId" => $clientId] + ); $lv = new LiveVideo(); $lv->load($response->getDecodedBody()); $this->assertEquals($clientId, $lv->clientId); @@ -57,9 +69,9 @@ public function testCreateLiveVideo($clientId): string } /** - * @depends testCreatePersonForVideo - * @depends testCreateLiveVideo - */ + * @depends testCreatePersonForVideo + * @depends testCreateLiveVideo + */ public function testGetLiveVideo($clientId, $liveVideoId) { $lv = new LiveVideo(); @@ -70,10 +82,10 @@ public function testGetLiveVideo($clientId, $liveVideoId) $this->assertNotNull($result->challenges); $this->assertGreaterThan(0, count($result->challenges)); } - + /** - * @depends testCreatePersonForVideo - */ + * @depends testCreatePersonForVideo + */ public function testListLiveVideo($clientId) { $this->testCreateLiveVideo($clientId); @@ -82,11 +94,11 @@ public function testListLiveVideo($clientId) } /** - * @depends testCreateLiveVideo - */ + * @depends testCreateLiveVideo + */ public function testDeleteLivePhoto($liveVideoId) { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $this->complycube->livevideos()->delete($liveVideoId); $this->complycube->livevideos()->get($liveVideoId); } diff --git a/tests/integration/ReportTest.php b/tests/integration/ReportTest.php index a5af394..ce1efd3 100644 --- a/tests/integration/ReportTest.php +++ b/tests/integration/ReportTest.php @@ -2,35 +2,33 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; -use ComplyCube\Model\Report; - use ComplyCube\Model\Check; use ComplyCube\Model\Client; use ComplyCube\Model\PersonDetails; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\Resources\ReportApi */ -class ReportTest extends \PHPUnit\Framework\TestCase +class ReportTest extends TestCase { - private $personClient; - private $complycube; + private ?ComplyCubeClient $complycube; + private ?Client $personClient; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } if (empty($this->personClient)) { $personDetails = new PersonDetails(); - $personDetails->firstName = 'Richard'; - $personDetails->lastName = 'Nixon'; + $personDetails->firstName = "Richard"; + $personDetails->lastName = "Nixon"; $newClient = new Client(); - $newClient->type = 'person'; - $newClient->email = 'john@doe.com'; + $newClient->type = "person"; + $newClient->email = "john@doe.com"; $newClient->personDetails = $personDetails; $this->personClient = $newClient; } @@ -44,33 +42,43 @@ public function testCreatePersonClient(): string } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testCreateSimpleCheck($clientId): string { $check = new Check(); - $check->type = 'extensive_screening_check'; + $check->type = "extensive_screening_check"; $result = $this->complycube->checks()->create($clientId, $check); $this->assertEquals($result->type, $result->type); return $result->id; } /** - * @depends testCreatePersonClient - */ + * @depends testCreatePersonClient + */ public function testGenerateClientReport(string $clientId): void { - $result = $this->complycube->reports()->generate(['clientId' => $clientId]); + $result = $this->complycube + ->reports() + ->generate(["clientId" => $clientId]); $this->assertNotNull($result->contentType); $this->assertNotNull($result->data); } /** - * @depends testCreateSimpleCheck - */ + * @depends testCreateSimpleCheck + */ public function testGenerateCheckReport($checkId): void { - $result = $this->complycube->reports()->generate(['checkId' => $checkId]); + $check = $this->complycube->checks()->get($checkId); + while ($check->status == "pending") { + sleep(5); + $check = $this->complycube->checks()->get($checkId); + } + + $result = $this->complycube + ->reports() + ->generate(["checkId" => $check->id]); $this->assertNotNull($result->contentType); $this->assertNotNull($result->data); } diff --git a/tests/integration/RiskProfileTest.php b/tests/integration/RiskProfileTest.php index 541e6a4..fe31edd 100644 --- a/tests/integration/RiskProfileTest.php +++ b/tests/integration/RiskProfileTest.php @@ -2,34 +2,32 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; -use ComplyCube\Model\RiskProfile; -use ComplyCube\Model\PersonDetails; use ComplyCube\Model\Client; +use ComplyCube\Model\PersonDetails; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\Resources\RiskProfileApi */ -class RiskProfileTest extends \PHPUnit\Framework\TestCase +class RiskProfileTest extends TestCase { - private $complycube; - private $document; - private $personClient; + private ?ComplyCubeClient $complycube; + private ?Client $personClient; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } if (empty($this->personClient)) { $personDetails = new PersonDetails(); - $personDetails->firstName = 'Richard'; - $personDetails->lastName = 'Nixon'; + $personDetails->firstName = "Richard"; + $personDetails->lastName = "Nixon"; $newClient = new Client(); - $newClient->type = 'person'; - $newClient->email = 'john@doe.com'; + $newClient->type = "person"; + $newClient->email = "john@doe.com"; $newClient->personDetails = $personDetails; $this->personClient = $newClient; } @@ -43,8 +41,8 @@ public function testCreatePersonForDocument(): string } /** - * @depends testCreatePersonForDocument - */ + * @depends testCreatePersonForDocument + */ public function testGetRiskProfile($clientId) { $result = $this->complycube->riskProfiles()->get($clientId); diff --git a/tests/integration/SDKTokenTest.php b/tests/integration/SDKTokenTest.php index c8eb43d..a05551d 100644 --- a/tests/integration/SDKTokenTest.php +++ b/tests/integration/SDKTokenTest.php @@ -2,36 +2,37 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; -use ComplyCube\Model\Report; +use ComplyCube\Exception\ComplyCubeClientException; use ComplyCube\Model\Client; -use ComplyCube\Model\PersonDetails; +use ComplyCube\Model\Token; +use PHPUnit\Framework\TestCase; +use TypeError; /** * @covers \ComplyCube\Resources\TokenApi */ -class SDKTokenTest extends \PHPUnit\Framework\TestCase +class SDKTokenTest extends TestCase { - private $complycube; - private $personClient; + private ?ComplyCubeClient $complycube; + private ?Client $personClient; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } if (empty($this->personClient)) { - $personDetails = new PersonDetails(); - $personDetails->firstName = 'Richard'; - $personDetails->lastName = 'Nixon'; - $newClient = new Client(); - $newClient->type = 'person'; - $newClient->email = 'john@doe.com'; - $newClient->personDetails = $personDetails; - $this->personClient = $newClient; + $this->personClient = new Client([ + "type" => "person", + "email" => "john@doe.com", + "personDetails" => [ + "firstName" => "Richard", + "lastName" => "Nixon", + ], + ]); } } @@ -45,9 +46,67 @@ public function testCreatePersonClient(): string /** * @depends testCreatePersonClient */ - public function testGenerateToken(string $clientId): void + public function testGenerateWebSDKToken(string $clientId): void { - $result = $this->complycube->tokens()->generate($clientId, 'https://referrer.com/*'); - $this->assertNotNull($result->token); + $result = $this->complycube + ->tokens() + ->generate($clientId, "https://referrer.com/*"); + + $this->assertInstanceOf(Token::class, $result); + } + + /** + * @depends testCreatePersonClient + */ + public function testGenerateMobileSDKToken(string $clientId): void + { + $result = $this->complycube + ->tokens() + ->generate($clientId, "com.myapp.demo.app"); + + $this->assertInstanceOf(Token::class, $result); + } + + /** + * @depends testCreatePersonClient + */ + public function testGenerateWebSDKTokenWithInvalidClientId( + string $clientId + ): void { + $this->expectException(ComplyCubeClientException::class); + $this->complycube + ->tokens() + ->generate("non existent client id", "https://referrer.com/*"); + } + + /** + * @depends testCreatePersonClient + */ + public function testGenerateMobileSDKTokenWithInvalidClientId( + string $clientId + ): void { + $this->expectException(ComplyCubeClientException::class); + $this->complycube + ->tokens() + ->generate("non existent client id", "com.myapp.demo.app"); + } + + /** + * @depends testCreatePersonClient + */ + public function testGenerateTokenWithInvalidReferrerOrAppId( + string $clientId + ): void { + $this->expectException(ComplyCubeClientException::class); + $this->complycube->tokens()->generate($clientId, "random stuff"); + } + + /** + * @depends testCreatePersonClient + */ + public function testGenerateTokenWithNullSDKInfo(string $clientId): void + { + $this->expectException(TypeError::class); + $this->complycube->tokens()->generate($clientId, null); } } diff --git a/tests/integration/StaticTest.php b/tests/integration/StaticTest.php index 9f22594..17fd2a2 100644 --- a/tests/integration/StaticTest.php +++ b/tests/integration/StaticTest.php @@ -2,21 +2,20 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; -use ComplyCube\Model\Report; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\ComplyCubeClient */ -class StaticTest extends \PHPUnit\Framework\TestCase +class StaticTest extends TestCase { - private $complycube; + private ?ComplyCubeClient $complycube; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } } @@ -24,6 +23,14 @@ protected function setUp(): void public function testScreeningLists(): void { $result = $this->complycube->screeningLists(); + $this->assertIsIterable($result); + $this->assertGreaterThan(0, count($result)); + } + + public function testSupportedDocuments(): void + { + $result = $this->complycube->supportedDocuments(); + $this->assertIsIterable($result); $this->assertGreaterThan(0, count($result)); } } diff --git a/tests/integration/TeamMemberTest.php b/tests/integration/TeamMemberTest.php index 37ca31f..1bfb1e3 100644 --- a/tests/integration/TeamMemberTest.php +++ b/tests/integration/TeamMemberTest.php @@ -2,21 +2,21 @@ namespace ComplyCube\Tests\Integration; -use ComplyCube\ApiClient; use ComplyCube\ComplyCubeClient; -use ComplyCube\Model\TeamMember; +use ComplyCube\Exception\ComplyCubeClientException; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\Resources\TeamMemberApi */ -class TeamMemberTest extends \PHPUnit\Framework\TestCase +class TeamMemberTest extends TestCase { - private $complycube; + private ?ComplyCubeClient $complycube; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); + $apiKey = getenv("CC_API_KEY"); $this->complycube = new ComplyCubeClient($apiKey); } } @@ -29,8 +29,8 @@ public function testListTeamMembers() } /** - * @depends testListTeamMembers - */ + * @depends testListTeamMembers + */ public function testGetTeamMember($teamMember) { $result = $this->complycube->teamMembers()->get($teamMember->id); @@ -39,17 +39,19 @@ public function testGetTeamMember($teamMember) public function testGetNonExistentTeamMember() { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $this->complycube->teamMembers()->get('NONEXISTENT'); + $this->expectException(ComplyCubeClientException::class); + $this->complycube->teamMembers()->get("NONEXISTENT"); } /** - * @depends testListTeamMembers - */ + * @depends testListTeamMembers + */ public function testFilterTeamMember($teamMember) { $amember = $this->complycube->teamMembers()->get($teamMember->id); - $result = $this->complycube->teamMembers()->list(['role' => $amember->role]); + $result = $this->complycube + ->teamMembers() + ->list(["role" => $amember->role]); foreach ($result as $res) { $this->assertEquals($amember->role, $res->role); } diff --git a/tests/integration/WebhookTest.php b/tests/integration/WebhookTest.php index ea04753..71b8a85 100644 --- a/tests/integration/WebhookTest.php +++ b/tests/integration/WebhookTest.php @@ -2,67 +2,105 @@ namespace ComplyCube\Tests\Integration; +use ComplyCube\ComplyCubeClient; +use ComplyCube\Exception\ComplyCubeClientException; +use ComplyCube\Model\ComplyCubeCollection; use ComplyCube\Model\Webhook; +use PHPUnit\Framework\TestCase; +use ReflectionProperty; /** * @covers \ComplyCube\Resources\WebhookApi */ -class WebhookTest extends \PHPUnit\Framework\TestCase +class WebhookTest extends TestCase { - private $personClient; - private $complycube; + private ?ComplyCubeClient $complycube; protected function setUp(): void { if (empty($this->complycube)) { - $apiKey = getenv('CC_API_KEY'); - $this->complycube = new \ComplyCube\ComplyCubeClient($apiKey); + $apiKey = getenv("CC_API_KEY"); + $this->complycube = new ComplyCubeClient($apiKey); } } + private function webhook_assertions($item) + { + $this->assertInstanceOf(Webhook::class, $item); + + $this->assertNotNull($item->id); + + foreach ($item->events as $value) { + $this->assertIsString($value); + } + + foreach (["createdAt", "updatedAt"] as $property_name) { + $item_reflection_property = new ReflectionProperty( + $item, + $property_name + ); + + $item_reflection_property->setAccessible(true); + + $this->assertNotNull($item_reflection_property->getValue($item)); + } + + $this->assertNull($item->description); + } + public function testCreateWebhook($enabled = false): Webhook { - $webhook = new Webhook(); - $webhook->url = 'http://hook.com/'; - $webhook->enabled = $enabled; - $webhook->events = ['check.pending']; + $webhook = new Webhook([ + "url" => "http://hook.com/", + "enabled" => $enabled, + "events" => ["check.pending"], + ]); $result = $this->complycube->webhooks()->create($webhook); + $this->webhook_assertions($result); + $this->assertNotNull($result->secret); $this->assertEquals($webhook->url, $result->url); $this->assertEquals($webhook->enabled, $result->enabled); $this->assertEquals($webhook->events[0], $result->events[0]); - $this->assertNotNull($result->secret); return $result; } /** - * @depends testCreateWebhook - */ + * @depends testCreateWebhook + */ public function testUpdateWebhookInline(Webhook $webhook): void { - $result = $this->complycube->webhooks()->update( - $webhook->id, - ['url' => 'https://newurl/endpoint', 'enabled' => false] - ); - $this->assertEquals('https://newurl/endpoint', $result->url); + $result = $this->complycube->webhooks()->update($webhook->id, [ + "url" => "https://newurl/endpoint", + "enabled" => false, + ]); + $this->webhook_assertions($result); + $this->assertNull($result->secret); + $this->assertEquals("https://newurl/endpoint", $result->url); } /** - * @depends testCreateWebhook - */ + * @depends testCreateWebhook + */ public function testUpdateWebhook(Webhook $webhook): void { $newWebhook = $webhook; - $newWebhook->url = 'https://newurl/endpoint'; - $result = $this->complycube->webhooks()->update($webhook->id, $newWebhook); + $newWebhook->url = "https://newurl/endpoint"; + $result = $this->complycube + ->webhooks() + ->update($webhook->id, $newWebhook); + $this->webhook_assertions($result); + $this->assertNull($result->secret); $this->assertEquals($newWebhook->url, $result->url); } /** - * @depends testCreateWebhook - */ + * @depends testCreateWebhook + */ public function testGetWebhook(Webhook $webhook): void { $result = $this->complycube->webhooks()->get($webhook->id); + $this->webhook_assertions($result); + $this->assertNull($result->secret); $this->assertEquals($webhook->id, $result->id); } @@ -70,7 +108,12 @@ public function testListWebhooks() { $this->testCreateWebhook(); $hooks = $this->complycube->webhooks()->list(); + $this->assertInstanceOf(ComplyCubeCollection::class, $hooks); $this->assertGreaterThan(0, $hooks->totalItems); + foreach ($hooks as $hook) { + $this->webhook_assertions($hook); + $this->assertNull($hook->secret); + } } public function testList2HooksOnly() @@ -78,24 +121,34 @@ public function testList2HooksOnly() $this->testCreateWebhook(); $this->testCreateWebhook(); $this->testCreateWebhook(true); - $hooks = $this->complycube->webhooks()->list(['page' => 1, 'pageSize' => 2]); + $hooks = $this->complycube + ->webhooks() + ->list(["page" => 1, "pageSize" => 2]); + $this->assertInstanceOf(ComplyCubeCollection::class, $hooks); $this->assertEquals(2, iterator_count($hooks)); + foreach ($hooks as $hook) { + $this->webhook_assertions($hook); + $this->assertNull($hook->secret); + } } public function testFilterEnabledHooksOnly() { - $hooks = $this->complycube->webhooks()->list(['enabled' => 'true']); + $hooks = $this->complycube->webhooks()->list(["enabled" => "true"]); + $this->assertInstanceOf(ComplyCubeCollection::class, $hooks); foreach ($hooks as $hook) { + $this->webhook_assertions($hook); + $this->assertNull($hook->secret); $this->assertEquals(true, $hook->enabled); } } /** - * @depends testCreateWebhook - */ + * @depends testCreateWebhook + */ public function testDeleteWebhook(Webhook $webhook): void { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); + $this->expectException(ComplyCubeClientException::class); $this->complycube->webhooks()->delete($webhook->id); $this->complycube->webhooks()->get($webhook->id); } @@ -103,11 +156,15 @@ public function testDeleteWebhook(Webhook $webhook): void public function testClearWebhooks() { $hooks = $this->complycube->webhooks()->list(); + $this->assertInstanceOf(ComplyCubeCollection::class, $hooks); foreach ($hooks as $hook) { + $this->webhook_assertions($hook); + $this->assertNull($hook->secret); sleep(3); $this->complycube->webhooks()->delete($hook->id); } $hooks = $this->complycube->webhooks()->list(); + $this->assertInstanceOf(ComplyCubeCollection::class, $hooks); $this->assertEquals(0, $hooks->totalItems); } } diff --git a/tests/unit/ApiClientTest.php b/tests/unit/ApiClientTest.php index b2e08a9..d197c09 100644 --- a/tests/unit/ApiClientTest.php +++ b/tests/unit/ApiClientTest.php @@ -3,113 +3,138 @@ namespace ComplyCube\Tests\Unit; use ComplyCube\ApiClient; +use ComplyCube\Exception\ComplyCubeClientException; +use ComplyCube\Exception\ComplyCubeServerException; use GuzzleHttp\Client; use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\HandlerStack; use GuzzleHttp\Psr7\Response; use GuzzleRetry\GuzzleRetryMiddleware; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\ApiClient */ -class ApiClientTest extends \PHPUnit\Framework\TestCase +class ApiClientTest extends TestCase { protected $apiClient; protected $mockHandler; - protected function setUp() : void + protected function setUp(): void { $this->mockHandler = new MockHandler(); $httpClient = new Client([ - 'handler' => $this->mockHandler + "handler" => $this->mockHandler, ]); - $this->apiClient = new ApiClient('', 2); + $this->apiClient = new ApiClient("", 2); $this->apiClient->httpClient = $httpClient; } - + public function testGetRequest() { - $this->mockHandler->append(new Response(200, [], "{ \"id\":\"value\"}")); - $apiResponse = $this->apiClient->get('endpoint'); - $responseBody = $apiResponse->getDecodedBody(); + $this->mockHandler->append( + new Response(200, [], "{ \"id\":\"value\"}"), + ); + $apiResponse = $this->apiClient->get("endpoint"); + $responseBody = $apiResponse->getDecodedBody(); $this->assertEquals(200, $apiResponse->getHttpStatusCode()); - $this->assertObjectHasAttribute('id', $responseBody); - $this->assertEquals('value', $responseBody->id); + $this->assertTrue(property_exists($responseBody, "id")); + $this->assertEquals("value", $responseBody->id); } public function testNullBodyPostRequest() { $this->mockHandler->append(new Response(200, [], "{}")); - $apiResponse = $this->apiClient->post('endpoint', [], null); - $responseBody = $apiResponse->getDecodedBody(); + $apiResponse = $this->apiClient->post("endpoint", [], null); + $responseBody = $apiResponse->getDecodedBody(); $this->assertEquals(200, $apiResponse->getHttpStatusCode()); } public function testEmptyPostRequest() { $this->mockHandler->append(new Response(200, [], "{}")); - $apiResponse = $this->apiClient->post('endpoint', [], (object)[]); + $apiResponse = $this->apiClient->post("endpoint", [], (object) []); $this->assertEquals(200, $apiResponse->getHttpStatusCode()); } public function testDeleteRequest() { $this->mockHandler->append(new Response(200, [], "{}")); - $apiResponse = $this->apiClient->delete('endpoint'); - $this->assertEquals(null, $apiResponse); + $this->assertNull($this->apiClient->delete("endpoint")); } public function testRetryAttemptRequest() { $value = ApiClient::randomJitter(3, null); - $this->assertLessThan(3**1.5, $value); + $this->assertLessThan(3 ** 1.5, $value); } public function testClientExceptionRequest() { - $this->expectException(\ComplyCube\Exception\ComplyCubeClientException::class); - $stack = HandlerStack::create(new MockHandler([new Response(404, [], "{}")])); - $stack->push(GuzzleRetryMiddleware::factory([ - 'max_retry_attempts' => 1, - 'default_retry_multiplier' => [ApiClient::class, 'randomJitter']])); - $this->apiClient->httpClient = new Client(['handler' => $stack]); - $apiResponse = $this->apiClient->get('endpoint'); + $this->expectException(ComplyCubeClientException::class); + $stack = HandlerStack::create( + new MockHandler([new Response(404, [], "{}")]), + ); + $stack->push( + GuzzleRetryMiddleware::factory([ + "max_retry_attempts" => 1, + "default_retry_multiplier" => [ + ApiClient::class, + "randomJitter", + ], + ]), + ); + $this->apiClient->httpClient = new Client(["handler" => $stack]); + $this->apiClient->get("endpoint"); } public function testRetryPass() { - $stack = HandlerStack::create(new MockHandler([ - new Response(503, [], "{}"), - new Response(200, [], "{}"), - new Response(503, [], "{}") - ])); - $stack->push(GuzzleRetryMiddleware::factory([ - 'max_retry_attempts' => 1, - 'default_retry_multiplier' => function ($numRequests, $response): float { - return (float) rand(0, $numRequests ** 1.5); - } - ])); - $this->apiClient->httpClient = new Client(['handler' => $stack]); - $apiResponse = $this->apiClient->get('endpoint'); + $stack = HandlerStack::create( + new MockHandler([ + new Response(503, [], "{}"), + new Response(200, [], "{}"), + new Response(503, [], "{}"), + ]), + ); + $stack->push( + GuzzleRetryMiddleware::factory([ + "max_retry_attempts" => 1, + "default_retry_multiplier" => function ( + $numRequests, + $response + ): float { + return (float) rand(0, $numRequests ** 1.5); + }, + ]), + ); + $this->apiClient->httpClient = new Client(["handler" => $stack]); + $apiResponse = $this->apiClient->get("endpoint"); $this->assertEquals(200, $apiResponse->getHttpStatusCode()); } public function testRetryFail() { - $this->expectException(\ComplyCube\Exception\ComplyCubeServerException::class); - $stack = HandlerStack::create(new MockHandler([ - new Response(503, [], "{}"), - new Response(503, [], "{}"), - new Response(200, [], "{}") - ])); - $stack->push(GuzzleRetryMiddleware::factory([ - 'max_retry_attempts' => 1, - 'default_retry_multiplier' => function ($numRequests, $response): float { - return (float) rand(0, $numRequests ** 1.5); - } - ])); - $this->apiClient->httpClient = new Client(['handler' => $stack]); - $apiResponse = $this->apiClient->get('endpoint', []); + $this->expectException(ComplyCubeServerException::class); + $stack = HandlerStack::create( + new MockHandler([ + new Response(503, [], "{}"), + new Response(503, [], "{}"), + new Response(200, [], "{}"), + ]), + ); + $stack->push( + GuzzleRetryMiddleware::factory([ + "max_retry_attempts" => 1, + "default_retry_multiplier" => function ( + $numRequests, + $response + ): float { + return (float) rand(0, $numRequests ** 1.5); + }, + ]), + ); + $this->apiClient->httpClient = new Client(["handler" => $stack]); + $this->apiClient->get("endpoint", []); } - } diff --git a/tests/unit/ApiResourceTest.php b/tests/unit/ApiResourceTest.php index 4548c81..782c16d 100644 --- a/tests/unit/ApiResourceTest.php +++ b/tests/unit/ApiResourceTest.php @@ -2,32 +2,35 @@ namespace ComplyCube\Tests\Unit; -use ComplyCube\ApiResource; use ComplyCube\ApiClient; +use ComplyCube\ApiResource; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\ApiResource */ -class ApiResourceTest extends \PHPUnit\Framework\TestCase +class ApiResourceTest extends TestCase { protected $newAnonymousClassFromAbstract; - protected function setUp() : void + protected function setUp(): void { - $a_client = new ApiClient(''); - $this->newAnonymousClassFromAbstract = new class($a_client,'a\class') extends ApiResource { + $a_client = new ApiClient(""); + $this->newAnonymousClassFromAbstract = new class ($a_client, "a\class") + extends ApiResource + { public function returnThis() { return $this; } }; } - + public function testAbstractClassType() { $this->assertInstanceOf( ApiResource::class, - $this->newAnonymousClassFromAbstract->returnThis() + $this->newAnonymousClassFromAbstract->returnThis(), ); } } diff --git a/tests/unit/ApiResponseTest.php b/tests/unit/ApiResponseTest.php index ae87223..b406d8b 100644 --- a/tests/unit/ApiResponseTest.php +++ b/tests/unit/ApiResponseTest.php @@ -3,16 +3,17 @@ namespace ComplyCube\Tests\Unit; use ComplyCube\ApiResponse; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\ApiResponse */ -class ApiResponseTest extends \PHPUnit\Framework\TestCase +class ApiResponseTest extends TestCase { public function testNoApiResponse() { $response = new ApiResponse(200, null); - $this->assertEquals((object)[], $response->getDecodedBody()); + $this->assertEquals((object) [], $response->getDecodedBody()); } public function testSuccessStatusCodeResponse() @@ -23,14 +24,14 @@ public function testSuccessStatusCodeResponse() public function testHeadersResponse() { - $headers = ['A-Header' => 'A-Value']; + $headers = ["A-Header" => "A-Value"]; $response = new ApiResponse(200, null, $headers); $this->assertEquals($headers, $response->getHeaders()); } public function testBodyResponse() { - $body = '{}'; + $body = "{}"; $response = new ApiResponse(200, $body); $this->assertEquals($body, $response->getBody()); } @@ -38,29 +39,32 @@ public function testBodyResponse() public function testEmptyApiResponse() { $response = new ApiResponse(200, "{}"); - $this->assertEquals((object)[], $response->getDecodedBody()); + $this->assertEquals((object) [], $response->getDecodedBody()); } public function testSingleLevelApiResponse() { $response = new ApiResponse(200, "{ \"key\" : \"value\" }"); $body = $response->getDecodedBody(); - $this->assertObjectHasAttribute('key', $body); - $this->assertEquals('value', $body->key); + $this->assertTrue(property_exists($body, "key")); + $this->assertEquals("value", $body->key); } public function testNestedApiResponse() { - $response = new ApiResponse(200, "{ \"key\": { \"nestedKey\" : \"nestedValue\" } }"); + $response = new ApiResponse( + 200, + "{ \"key\": { \"nestedKey\" : \"nestedValue\" } }", + ); $body = $response->getDecodedBody(); - $this->assertObjectHasAttribute('key', $body); - $this->assertObjectHasAttribute('nestedKey', $body->key); - $this->assertEquals('nestedValue', $body->key->nestedKey); + $this->assertTrue(property_exists($body, "key")); + $this->assertTrue(property_exists($body->key, "nestedKey")); + $this->assertEquals("nestedValue", $body->key->nestedKey); } public function testInvalidJsonResponse() { $this->expectException(\JsonException::class); - $response = new ApiResponse(200, "InvalidJSON"); + new ApiResponse(200, "InvalidJSON"); } } diff --git a/tests/unit/EventVerifierTest.php b/tests/unit/EventVerifierTest.php index 4c6d92e..d850d02 100644 --- a/tests/unit/EventVerifierTest.php +++ b/tests/unit/EventVerifierTest.php @@ -3,31 +3,37 @@ namespace ComplyCube\Tests\Unit; use ComplyCube\EventVerifier; +use PHPUnit\Framework\TestCase; /** * @covers \ComplyCube\EventVerifier */ -class EventVerifierTest extends \PHPUnit\Framework\TestCase +class EventVerifierTest extends TestCase { public function testNullResponse() { $this->expectException(\TypeError::class); - $ev = new EventVerifier('a_webhook_signature'); - $ev->constructEvent(null, 'an_event_signature'); + $ev = new EventVerifier("a_webhook_signature"); + $ev->constructEvent(null, "an_event_signature"); } public function testInvalidSignatureEvent() { - $this->expectException(\ComplyCube\Exception\VerificationException::class); - $ev = new EventVerifier('a_webhook_signature'); - $ev->constructEvent('a_response', 'an_event_signature'); + $this->expectException( + \ComplyCube\Exception\VerificationException::class, + ); + $ev = new EventVerifier("a_webhook_signature"); + $ev->constructEvent("a_response", "an_event_signature"); } public function testValidSignatureEvent() { $resp = "{\"id\":\"value\"}"; - $ev = new EventVerifier('a_webhook_signature'); - $e = $ev->constructEvent($resp, 'bc00414fa4d54277a3ed01e5ee258d9800a918a7791c7cda16d38b82f38f2150'); - $this->assertEquals('value', $e->id); + $ev = new EventVerifier("a_webhook_signature"); + $e = $ev->constructEvent( + $resp, + "bc00414fa4d54277a3ed01e5ee258d9800a918a7791c7cda16d38b82f38f2150", + ); + $this->assertEquals("value", $e->id); } }