From 5db76f70d51189d4aaaac1aa7b23bfc8a4aa10ca Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Thu, 7 Sep 2023 16:43:34 +0200 Subject: [PATCH 1/3] fix(rules): add support for PHP --- src/analyser/__snapshots__/index.test.ts.snap | 710 +++++++++++++++++- src/loader.ts | 1 + src/rules/__snapshots__/index.test.ts.snap | 1 + src/rules/analytics/amplitude.ts | 1 + src/rules/analytics/googleanalytics.ts | 6 + src/rules/analytics/mixpanel.ts | 1 + src/rules/api/gcp.aiplatform.ts | 1 + src/rules/api/gcp.language.ts | 1 + src/rules/api/gcp.speech.ts | 1 + src/rules/api/gcp.translate.ts | 1 + src/rules/api/gcp.vision.ts | 1 + src/rules/db/firebase.firestore.ts | 1 + src/rules/db/gcp.bigquery.ts | 1 + src/rules/db/gcp.bigtable.ts | 1 + src/rules/db/gcp.datastore.ts | 1 + src/rules/db/gcp.secretmanager.ts | 1 + src/rules/db/gcp.sql.ts | 1 + src/rules/db/redis.ts | 1 + src/rules/etl/gcp.dataproc.ts | 1 + src/rules/hosting/aws.ts | 1 + src/rules/hosting/gcp.cloudrun.ts | 1 + src/rules/hosting/gcp.functions.ts | 2 + src/rules/hosting/gcp.gce.ts | 1 + src/rules/hosting/gcp.ts | 1 + src/rules/messaging/gcp.pubsub.ts | 1 + src/rules/php/doctrinephp.ts | 11 + src/rules/php/index.ts | 5 + src/rules/php/laravel.ts | 9 + src/rules/php/phpunit.ts | 9 + src/rules/php/symfony.ts | 9 + src/rules/php/twig.ts | 8 + src/rules/saas/algolia.ts | 1 + src/rules/saas/github.ts | 2 +- .../__snapshots__/component.test.ts.snap | 6 + src/rules/spec/index.ts | 1 + .../php/__snapshots__/component.test.ts.snap | 183 +++++ src/rules/spec/php/component.test.ts | 59 ++ src/rules/spec/php/component.ts | 60 ++ src/rules/spec/php/index.ts | 12 + ...ent.test.ts.snap => lockfile.test.ts.snap} | 0 src/rules/spec/ruby/index.ts | 4 +- .../{component.test.ts => lockfile.test.ts} | 0 .../spec/ruby/{component.ts => lockfile.ts} | 5 +- src/rules/storage/gcp.gcs.ts | 1 + src/rules/tool/gcp.cloudbuild.ts | 1 + src/types/rule.ts | 1 + src/types/techs.ts | 5 + tests/__fixtures__/php/composer.json | 79 ++ 48 files changed, 1182 insertions(+), 29 deletions(-) create mode 100644 src/rules/php/doctrinephp.ts create mode 100644 src/rules/php/index.ts create mode 100644 src/rules/php/laravel.ts create mode 100644 src/rules/php/phpunit.ts create mode 100644 src/rules/php/symfony.ts create mode 100644 src/rules/php/twig.ts create mode 100644 src/rules/spec/php/__snapshots__/component.test.ts.snap create mode 100644 src/rules/spec/php/component.test.ts create mode 100644 src/rules/spec/php/component.ts create mode 100644 src/rules/spec/php/index.ts rename src/rules/spec/ruby/__snapshots__/{component.test.ts.snap => lockfile.test.ts.snap} (100%) rename src/rules/spec/ruby/{component.test.ts => lockfile.test.ts} (100%) rename src/rules/spec/ruby/{component.ts => lockfile.ts} (93%) create mode 100644 tests/__fixtures__/php/composer.json diff --git a/src/analyser/__snapshots__/index.test.ts.snap b/src/analyser/__snapshots__/index.test.ts.snap index ef663419..61d60358 100644 --- a/src/analyser/__snapshots__/index.test.ts.snap +++ b/src/analyser/__snapshots__/index.test.ts.snap @@ -131,7 +131,7 @@ exports[`analyser > should run correctly 1`] = ` "childs": [], "dependencies": [], "edges": [], - "id": "18", + "id": "21", "inComponent": null, "languages": {}, "name": "Datadog", @@ -170,11 +170,11 @@ exports[`analyser > should run correctly 1`] = ` "edges": [ { "read": true, - "target": "18", + "target": "21", "write": true, }, ], - "id": "17", + "id": "20", "inComponent": null, "languages": { "JSON": 1, @@ -205,7 +205,7 @@ exports[`analyser > should run correctly 1`] = ` "childs": [], "dependencies": [], "edges": [], - "id": "20", + "id": "23", "inComponent": null, "languages": {}, "name": "Vercel", @@ -242,8 +242,8 @@ exports[`analyser > should run correctly 1`] = ` ], ], "edges": [], - "id": "19", - "inComponent": "20", + "id": "22", + "inComponent": "23", "languages": { "HTML": 1, "JSON": 1, @@ -279,7 +279,7 @@ exports[`analyser > should run correctly 1`] = ` ], ], "edges": [], - "id": "24", + "id": "27", "inComponent": null, "languages": {}, "name": "Google Cloud Platform", @@ -319,7 +319,7 @@ exports[`analyser > should run correctly 1`] = ` ], ], "edges": [], - "id": "25", + "id": "28", "inComponent": null, "languages": {}, "name": "Vercel", @@ -342,7 +342,7 @@ exports[`analyser > should run correctly 1`] = ` ], ], "edges": [], - "id": "22", + "id": "25", "inComponent": null, "languages": { "TOML": 1, @@ -382,6 +382,258 @@ exports[`analyser > should run correctly 1`] = ` "rust", ], }, + { + "childs": [ + { + "childs": [], + "dependencies": [], + "edges": [], + "id": "19", + "inComponent": null, + "languages": {}, + "name": "Algolia", + "path": [ + "/php/composer.json", + ], + "reason": [ + "algolia matched: /^algolia\\\\/algoliasearch-client-php$/", + ], + "tech": "algolia", + "techs": [], + }, + { + "childs": [], + "dependencies": [], + "edges": [], + "id": "18", + "inComponent": null, + "languages": {}, + "name": "Redis", + "path": [ + "/php/composer.json", + ], + "reason": [ + "redis matched: /^predis\\\\/predis$/", + ], + "tech": "redis", + "techs": [], + }, + ], + "dependencies": [ + [ + "php", + "mockery/mockery", + "~1.0", + ], + [ + "php", + "phpunit/phpunit", + "^9.0", + ], + [ + "php", + "php-mock/php-mock-mockery", + "^1.3", + ], + [ + "php", + "dms/phpunit-arraysubset-asserts", + "^0.2.1", + ], + [ + "php", + "fakerphp/faker", + "^1.13", + ], + [ + "php", + "slevomat/coding-standard", + "^7.0", + ], + [ + "php", + "nunomaduro/larastan", + "^2.1", + ], + [ + "php", + "laravel/tinker", + "^2.7", + ], + [ + "php", + "php", + ">=8.0", + ], + [ + "php", + "laravel/framework", + "^9.0", + ], + [ + "php", + "james-heinrich/getid3", + "^1.9", + ], + [ + "php", + "guzzlehttp/guzzle", + "^7.0.1", + ], + [ + "php", + "aws/aws-sdk-php-laravel", + "^3.1", + ], + [ + "php", + "pusher/pusher-php-server", + "^4.0", + ], + [ + "php", + "predis/predis", + "~1.0", + ], + [ + "php", + "jackiedo/dotenv-editor", + "^2.0", + ], + [ + "php", + "ext-exif", + "*", + ], + [ + "php", + "ext-gd", + "*", + ], + [ + "php", + "ext-fileinfo", + "*", + ], + [ + "php", + "ext-json", + "*", + ], + [ + "php", + "ext-SimpleXML", + "*", + ], + [ + "php", + "daverandom/resume", + "^0.0.3", + ], + [ + "php", + "laravel/helpers", + "^1.0", + ], + [ + "php", + "intervention/image", + "^2.5", + ], + [ + "php", + "doctrine/dbal", + "^3.0", + ], + [ + "php", + "lstrojny/functional-php", + "^1.14", + ], + [ + "php", + "teamtnt/laravel-scout-tntsearch-driver", + "^11.1", + ], + [ + "php", + "algolia/algoliasearch-client-php", + "^3.3", + ], + [ + "php", + "laravel/ui", + "^3.2", + ], + [ + "php", + "webmozart/assert", + "^1.10", + ], + [ + "php", + "laravel/sanctum", + "^2.15", + ], + [ + "php", + "laravel/scout", + "^9.4", + ], + [ + "php", + "nunomaduro/collision", + "^6.2", + ], + [ + "php", + "jwilsson/spotify-web-api-php", + "^5.2", + ], + [ + "php", + "meilisearch/meilisearch-php", + "^0.24.0", + ], + [ + "php", + "http-interop/http-factory-guzzle", + "^1.2", + ], + ], + "edges": [ + { + "read": true, + "target": "18", + "write": true, + }, + { + "read": true, + "target": "19", + "write": true, + }, + ], + "id": "17", + "inComponent": null, + "languages": { + "JSON": 1, + }, + "name": "symfony/translation", + "path": [ + "/php/composer.json", + ], + "reason": [ + "redis matched: /^predis\\\\/predis$/", + "algolia matched: /^algolia\\\\/algoliasearch-client-php$/", + "matched file: composer.json", + ], + "tech": null, + "techs": [ + "algolia", + "php", + "redis", + ], + }, ], "dependencies": [ [ @@ -569,11 +821,11 @@ exports[`analyser > should run correctly 2`] = ` "edges": [ { "read": true, - "target": "18", + "target": "21", "write": true, }, ], - "id": "17", + "id": "20", "inComponent": null, "languages": { "JSON": 1, @@ -619,12 +871,12 @@ exports[`analyser > should run correctly 2`] = ` "edges": [ { "read": true, - "target": "17", + "target": "20", "write": true, }, ], - "id": "19", - "inComponent": "20", + "id": "22", + "inComponent": "23", "languages": { "HTML": 1, "JSON": 1, @@ -648,7 +900,22 @@ exports[`analyser > should run correctly 2`] = ` "childs": [], "dependencies": [], "edges": [], - "id": "18", + "id": "19", + "inComponent": null, + "languages": {}, + "name": "Algolia", + "path": [ + "/php/composer.json", + ], + "reason": [], + "tech": "algolia", + "techs": [], + }, + { + "childs": [], + "dependencies": [], + "edges": [], + "id": "21", "inComponent": null, "languages": {}, "name": "Datadog", @@ -669,7 +936,7 @@ exports[`analyser > should run correctly 2`] = ` ], ], "edges": [], - "id": "24", + "id": "27", "inComponent": null, "languages": {}, "name": "Google Cloud Platform", @@ -690,7 +957,7 @@ exports[`analyser > should run correctly 2`] = ` ], ], "edges": [], - "id": "20", + "id": "23", "inComponent": null, "languages": {}, "name": "Vercel", @@ -795,7 +1062,7 @@ exports[`analyser > should run correctly 2`] = ` "Go": 1, "HCL": 1, "HTML": 1, - "JSON": 3, + "JSON": 4, "SCSS": 1, "TOML": 1, "YAML": 1, @@ -834,10 +1101,13 @@ exports[`analyser > should run correctly 2`] = ` "name": "redis", "path": [ "/docker-compose.yml", + "/php/composer.json", ], "reason": [], "tech": "redis", - "techs": [], + "techs": [ + "redis", + ], }, { "childs": [], @@ -849,7 +1119,7 @@ exports[`analyser > should run correctly 2`] = ` ], ], "edges": [], - "id": "22", + "id": "25", "inComponent": null, "languages": { "TOML": 1, @@ -884,6 +1154,219 @@ exports[`analyser > should run correctly 2`] = ` "rust", ], }, + { + "childs": [], + "dependencies": [ + [ + "php", + "mockery/mockery", + "~1.0", + ], + [ + "php", + "phpunit/phpunit", + "^9.0", + ], + [ + "php", + "php-mock/php-mock-mockery", + "^1.3", + ], + [ + "php", + "dms/phpunit-arraysubset-asserts", + "^0.2.1", + ], + [ + "php", + "fakerphp/faker", + "^1.13", + ], + [ + "php", + "slevomat/coding-standard", + "^7.0", + ], + [ + "php", + "nunomaduro/larastan", + "^2.1", + ], + [ + "php", + "laravel/tinker", + "^2.7", + ], + [ + "php", + "php", + ">=8.0", + ], + [ + "php", + "laravel/framework", + "^9.0", + ], + [ + "php", + "james-heinrich/getid3", + "^1.9", + ], + [ + "php", + "guzzlehttp/guzzle", + "^7.0.1", + ], + [ + "php", + "aws/aws-sdk-php-laravel", + "^3.1", + ], + [ + "php", + "pusher/pusher-php-server", + "^4.0", + ], + [ + "php", + "predis/predis", + "~1.0", + ], + [ + "php", + "jackiedo/dotenv-editor", + "^2.0", + ], + [ + "php", + "ext-exif", + "*", + ], + [ + "php", + "ext-gd", + "*", + ], + [ + "php", + "ext-fileinfo", + "*", + ], + [ + "php", + "ext-json", + "*", + ], + [ + "php", + "ext-SimpleXML", + "*", + ], + [ + "php", + "daverandom/resume", + "^0.0.3", + ], + [ + "php", + "laravel/helpers", + "^1.0", + ], + [ + "php", + "intervention/image", + "^2.5", + ], + [ + "php", + "doctrine/dbal", + "^3.0", + ], + [ + "php", + "lstrojny/functional-php", + "^1.14", + ], + [ + "php", + "teamtnt/laravel-scout-tntsearch-driver", + "^11.1", + ], + [ + "php", + "algolia/algoliasearch-client-php", + "^3.3", + ], + [ + "php", + "laravel/ui", + "^3.2", + ], + [ + "php", + "webmozart/assert", + "^1.10", + ], + [ + "php", + "laravel/sanctum", + "^2.15", + ], + [ + "php", + "laravel/scout", + "^9.4", + ], + [ + "php", + "nunomaduro/collision", + "^6.2", + ], + [ + "php", + "jwilsson/spotify-web-api-php", + "^5.2", + ], + [ + "php", + "meilisearch/meilisearch-php", + "^0.24.0", + ], + [ + "php", + "http-interop/http-factory-guzzle", + "^1.2", + ], + ], + "edges": [ + { + "read": true, + "target": "10", + "write": true, + }, + { + "read": true, + "target": "19", + "write": true, + }, + ], + "id": "17", + "inComponent": null, + "languages": { + "JSON": 1, + }, + "name": "symfony/translation", + "path": [ + "/php/composer.json", + ], + "reason": [], + "tech": null, + "techs": [ + "algolia", + "php", + "redis", + ], + }, { "childs": [], "dependencies": [ @@ -922,6 +1405,186 @@ exports[`analyser > should run correctly 2`] = ` "unknown", "7.17.5", ], + [ + "php", + "mockery/mockery", + "~1.0", + ], + [ + "php", + "phpunit/phpunit", + "^9.0", + ], + [ + "php", + "php-mock/php-mock-mockery", + "^1.3", + ], + [ + "php", + "dms/phpunit-arraysubset-asserts", + "^0.2.1", + ], + [ + "php", + "fakerphp/faker", + "^1.13", + ], + [ + "php", + "slevomat/coding-standard", + "^7.0", + ], + [ + "php", + "nunomaduro/larastan", + "^2.1", + ], + [ + "php", + "laravel/tinker", + "^2.7", + ], + [ + "php", + "php", + ">=8.0", + ], + [ + "php", + "laravel/framework", + "^9.0", + ], + [ + "php", + "james-heinrich/getid3", + "^1.9", + ], + [ + "php", + "guzzlehttp/guzzle", + "^7.0.1", + ], + [ + "php", + "aws/aws-sdk-php-laravel", + "^3.1", + ], + [ + "php", + "pusher/pusher-php-server", + "^4.0", + ], + [ + "php", + "predis/predis", + "~1.0", + ], + [ + "php", + "jackiedo/dotenv-editor", + "^2.0", + ], + [ + "php", + "ext-exif", + "*", + ], + [ + "php", + "ext-gd", + "*", + ], + [ + "php", + "ext-fileinfo", + "*", + ], + [ + "php", + "ext-json", + "*", + ], + [ + "php", + "ext-SimpleXML", + "*", + ], + [ + "php", + "daverandom/resume", + "^0.0.3", + ], + [ + "php", + "laravel/helpers", + "^1.0", + ], + [ + "php", + "intervention/image", + "^2.5", + ], + [ + "php", + "doctrine/dbal", + "^3.0", + ], + [ + "php", + "lstrojny/functional-php", + "^1.14", + ], + [ + "php", + "teamtnt/laravel-scout-tntsearch-driver", + "^11.1", + ], + [ + "php", + "algolia/algoliasearch-client-php", + "^3.3", + ], + [ + "php", + "laravel/ui", + "^3.2", + ], + [ + "php", + "webmozart/assert", + "^1.10", + ], + [ + "php", + "laravel/sanctum", + "^2.15", + ], + [ + "php", + "laravel/scout", + "^9.4", + ], + [ + "php", + "nunomaduro/collision", + "^6.2", + ], + [ + "php", + "jwilsson/spotify-web-api-php", + "^5.2", + ], + [ + "php", + "meilisearch/meilisearch-php", + "^0.24.0", + ], + [ + "php", + "http-interop/http-factory-guzzle", + "^1.2", + ], [ "npm", "dd-trace", @@ -1019,14 +1682,14 @@ exports[`analyser > should run correctly 2`] = ` ], ], "edges": [], - "id": "26", + "id": "29", "inComponent": null, "languages": { "AMPL": 2, "Go": 3, "HCL": 2, "HTML": 3, - "JSON": 8, + "JSON": 11, "SCSS": 3, "TOML": 3, "YAML": 2, @@ -1036,6 +1699,7 @@ exports[`analyser > should run correctly 2`] = ` "/", "/docker-compose.yml", "/deno/deno.lock", + "/php/composer.json", "/golang/cmd/server/main.go", "/pkgs/api/package.json", "/pkgs/app/package.json", @@ -1046,6 +1710,7 @@ exports[`analyser > should run correctly 2`] = ` "reason": [], "tech": null, "techs": [ + "algolia", "datadog", "deno", "docker", @@ -1054,6 +1719,7 @@ exports[`analyser > should run correctly 2`] = ` "gcp", "golang", "nodejs", + "php", "postgresql", "prettier", "prisma", diff --git a/src/loader.ts b/src/loader.ts index 4d897158..33233a3e 100644 --- a/src/loader.ts +++ b/src/loader.ts @@ -23,6 +23,7 @@ export const dependencies: Record< docker: [], golang: [], npm: [], + php: [], ruby: [], rust: [], terraform: [], diff --git a/src/rules/__snapshots__/index.test.ts.snap b/src/rules/__snapshots__/index.test.ts.snap index 0b3162c2..7b07a168 100644 --- a/src/rules/__snapshots__/index.test.ts.snap +++ b/src/rules/__snapshots__/index.test.ts.snap @@ -153,6 +153,7 @@ exports[`all > should match everything 1`] = ` "ovh", "pagerduty", "percona", + "php", "pingdom", "placekit", "planetscale", diff --git a/src/rules/analytics/amplitude.ts b/src/rules/analytics/amplitude.ts index 50b449fa..ed03d32c 100644 --- a/src/rules/analytics/amplitude.ts +++ b/src/rules/analytics/amplitude.ts @@ -7,5 +7,6 @@ register({ dependencies: [ { type: 'npm', name: 'amplitude-js' }, { type: 'npm', name: '@amplitude/analytics-browser' }, + { type: 'php', name: 'zumba/amplitude-php' }, ], }); diff --git a/src/rules/analytics/googleanalytics.ts b/src/rules/analytics/googleanalytics.ts index 32a70b54..23e07b23 100644 --- a/src/rules/analytics/googleanalytics.ts +++ b/src/rules/analytics/googleanalytics.ts @@ -4,4 +4,10 @@ register({ tech: 'googleanalytics', name: 'Google Analytics', type: 'analytics', + dependencies: [ + { type: 'php', name: 'google/analytics-data' }, + { type: 'php', name: 'spatie/laravel-analytics' }, + { type: 'php', name: 'theiconic/php-ga-measurement-protocol' }, + { type: 'php', name: 'google/analytics-admin' }, + ], }); diff --git a/src/rules/analytics/mixpanel.ts b/src/rules/analytics/mixpanel.ts index bfa8a721..9eec40a4 100644 --- a/src/rules/analytics/mixpanel.ts +++ b/src/rules/analytics/mixpanel.ts @@ -4,4 +4,5 @@ register({ tech: 'mixpanel', name: 'Mixpanel', type: 'analytics', + dependencies: [{ type: 'php', name: 'mixpanel/mixpanel-php' }], }); diff --git a/src/rules/api/gcp.aiplatform.ts b/src/rules/api/gcp.aiplatform.ts index 23c7579b..da935238 100644 --- a/src/rules/api/gcp.aiplatform.ts +++ b/src/rules/api/gcp.aiplatform.ts @@ -13,5 +13,6 @@ register({ example: 'google-cloud-ai_platform-v1', }, { type: 'golang', name: 'cloud.google.com/go/aiplatform' }, + { type: 'php', name: 'google/cloud-ai-platform' }, ], }); diff --git a/src/rules/api/gcp.language.ts b/src/rules/api/gcp.language.ts index b79aeab2..eb7cfbb4 100644 --- a/src/rules/api/gcp.language.ts +++ b/src/rules/api/gcp.language.ts @@ -12,5 +12,6 @@ register({ example: 'google-cloud-language-v1', }, { type: 'golang', name: 'cloud.google.com/go/language' }, + { type: 'php', name: 'google/cloud-language' }, ], }); diff --git a/src/rules/api/gcp.speech.ts b/src/rules/api/gcp.speech.ts index 7ac3ede3..944a28de 100644 --- a/src/rules/api/gcp.speech.ts +++ b/src/rules/api/gcp.speech.ts @@ -12,5 +12,6 @@ register({ example: 'google-cloud-speech-v1', }, { type: 'golang', name: 'cloud.google.com/go/speech' }, + { type: 'php', name: 'google/cloud-speech' }, ], }); diff --git a/src/rules/api/gcp.translate.ts b/src/rules/api/gcp.translate.ts index f6b2f6f2..3876b28f 100644 --- a/src/rules/api/gcp.translate.ts +++ b/src/rules/api/gcp.translate.ts @@ -13,5 +13,6 @@ register({ example: 'google-cloud-translate-v1', }, { type: 'golang', name: 'cloud.google.com/go/translate' }, + { type: 'php', name: 'google/cloud-translate' }, ], }); diff --git a/src/rules/api/gcp.vision.ts b/src/rules/api/gcp.vision.ts index 1496e009..e4968dab 100644 --- a/src/rules/api/gcp.vision.ts +++ b/src/rules/api/gcp.vision.ts @@ -12,5 +12,6 @@ register({ example: 'google-cloud-vision-v1', }, { type: 'golang', name: 'cloud.google.com/go/vision' }, + { type: 'php', name: 'google/cloud-vision' }, ], }); diff --git a/src/rules/db/firebase.firestore.ts b/src/rules/db/firebase.firestore.ts index 54f5ab43..9b2d8301 100644 --- a/src/rules/db/firebase.firestore.ts +++ b/src/rules/db/firebase.firestore.ts @@ -6,5 +6,6 @@ register({ type: 'db', dependencies: [ { type: 'terraform.resource', name: 'google_firestore_database' }, + { type: 'php', name: 'google/cloud-firestore' }, ], }); diff --git a/src/rules/db/gcp.bigquery.ts b/src/rules/db/gcp.bigquery.ts index fab2e707..c2e4e8cf 100644 --- a/src/rules/db/gcp.bigquery.ts +++ b/src/rules/db/gcp.bigquery.ts @@ -17,5 +17,6 @@ register({ { type: 'rust', name: 'gcp-bigquery-client' }, { type: 'ruby', name: 'google-cloud-bigquery' }, { type: 'golang', name: 'cloud.google.com/go/bigquery' }, + { type: 'php', name: 'google/cloud-bigquery' }, ], }); diff --git a/src/rules/db/gcp.bigtable.ts b/src/rules/db/gcp.bigtable.ts index 032e2b07..59eacf51 100644 --- a/src/rules/db/gcp.bigtable.ts +++ b/src/rules/db/gcp.bigtable.ts @@ -16,5 +16,6 @@ register({ }, { type: 'ruby', name: 'google-cloud-bigtable' }, { type: 'golang', name: 'cloud.google.com/go/bigtable' }, + { type: 'php', name: 'google/cloud-bigtable' }, ], }); diff --git a/src/rules/db/gcp.datastore.ts b/src/rules/db/gcp.datastore.ts index 265b3aab..39270cf9 100644 --- a/src/rules/db/gcp.datastore.ts +++ b/src/rules/db/gcp.datastore.ts @@ -12,5 +12,6 @@ register({ }, { type: 'ruby', name: 'google-cloud-datastore' }, { type: 'golang', name: 'cloud.google.com/go/datastore' }, + { type: 'php', name: 'google/cloud-datastore' }, ], }); diff --git a/src/rules/db/gcp.secretmanager.ts b/src/rules/db/gcp.secretmanager.ts index 865765e9..9805735d 100644 --- a/src/rules/db/gcp.secretmanager.ts +++ b/src/rules/db/gcp.secretmanager.ts @@ -16,5 +16,6 @@ register({ example: 'google-cloud-secret_manager-v1', }, { type: 'golang', name: 'cloud.google.com/go/secretmanager' }, + { type: 'php', name: 'google/cloud-secret-manager' }, ], }); diff --git a/src/rules/db/gcp.sql.ts b/src/rules/db/gcp.sql.ts index e9a7f023..198a77b1 100644 --- a/src/rules/db/gcp.sql.ts +++ b/src/rules/db/gcp.sql.ts @@ -19,5 +19,6 @@ register({ name: /^google-apis-sql/, example: 'google-apis-sqladmin_v1beta4', }, + { type: 'php', name: 'google/cloud-sql-admin' }, ], }); diff --git a/src/rules/db/redis.ts b/src/rules/db/redis.ts index ff1065e5..d2419045 100644 --- a/src/rules/db/redis.ts +++ b/src/rules/db/redis.ts @@ -12,5 +12,6 @@ register({ { type: 'rust', name: 'redis-async' }, { type: 'ruby', name: 'redis' }, { type: 'ruby', name: 'redis-client' }, + { type: 'php', name: 'predis/predis' }, ], }); diff --git a/src/rules/etl/gcp.dataproc.ts b/src/rules/etl/gcp.dataproc.ts index 56d58f97..1f1ff024 100644 --- a/src/rules/etl/gcp.dataproc.ts +++ b/src/rules/etl/gcp.dataproc.ts @@ -17,5 +17,6 @@ register({ example: 'google-cloud-dataproc-v1', }, { type: 'golang', name: 'cloud.google.com/go/dataproc' }, + { type: 'php', name: 'google/cloud-dataproc' }, ], }); diff --git a/src/rules/hosting/aws.ts b/src/rules/hosting/aws.ts index c83aff45..f56b4719 100644 --- a/src/rules/hosting/aws.ts +++ b/src/rules/hosting/aws.ts @@ -13,5 +13,6 @@ register({ { type: 'rust', name: /^aws-sdk/, example: 'aws-sdk-e2' }, { type: 'ruby', name: /^aws-sdk/, example: 'aws-sdk-e2' }, { type: 'docker', name: 'amazon/aws-cli' }, + { type: 'php', name: 'aws/aws-sdk-php' }, ], }); diff --git a/src/rules/hosting/gcp.cloudrun.ts b/src/rules/hosting/gcp.cloudrun.ts index 6d77d322..6ac8cec5 100644 --- a/src/rules/hosting/gcp.cloudrun.ts +++ b/src/rules/hosting/gcp.cloudrun.ts @@ -25,5 +25,6 @@ register({ example: 'google-cloud-run_v2', }, { type: 'golang', name: 'cloud.google.com/go/run' }, + { type: 'php', name: 'google/cloud-run' }, ], }); diff --git a/src/rules/hosting/gcp.functions.ts b/src/rules/hosting/gcp.functions.ts index 5ada7404..896d2cc0 100644 --- a/src/rules/hosting/gcp.functions.ts +++ b/src/rules/hosting/gcp.functions.ts @@ -17,5 +17,7 @@ register({ }, { type: 'ruby', name: 'functions_framework ' }, { type: 'golang', name: 'cloud.google.com/go/functions' }, + { type: 'php', name: 'google/cloud-functions-framework' }, + { type: 'php', name: 'google/cloud-functions' }, ], }); diff --git a/src/rules/hosting/gcp.gce.ts b/src/rules/hosting/gcp.gce.ts index be15ded4..4dc18958 100644 --- a/src/rules/hosting/gcp.gce.ts +++ b/src/rules/hosting/gcp.gce.ts @@ -9,5 +9,6 @@ register({ { type: 'terraform.resource', name: 'google_compute_instance' }, { type: 'ruby', name: 'google-cloud-compute' }, { type: 'golang', name: 'cloud.google.com/go/compute' }, + { type: 'php', name: 'google/cloud-compute' }, ], }); diff --git a/src/rules/hosting/gcp.ts b/src/rules/hosting/gcp.ts index 63717409..7c5dd733 100644 --- a/src/rules/hosting/gcp.ts +++ b/src/rules/hosting/gcp.ts @@ -10,5 +10,6 @@ register({ { type: 'terraform', name: 'registry.terraform.io/hashicorp/google' }, { type: 'ruby', name: /^google-cloud-/, example: 'google-cloud-storage' }, { type: 'rust', name: /^google-cloud-/, example: 'google-cloud-metadata' }, + { type: 'php', name: 'google/cloud' }, ], }); diff --git a/src/rules/messaging/gcp.pubsub.ts b/src/rules/messaging/gcp.pubsub.ts index 7f522889..689aeaf2 100644 --- a/src/rules/messaging/gcp.pubsub.ts +++ b/src/rules/messaging/gcp.pubsub.ts @@ -13,5 +13,6 @@ register({ { type: 'golang', name: 'cloud.google.com/go/pubsub' }, { type: 'rust', name: 'google-cloud-pubsub' }, { type: 'ruby', name: 'google-cloud-pubsub' }, + { type: 'php', name: 'google/cloud-pubsub' }, ], }); diff --git a/src/rules/php/doctrinephp.ts b/src/rules/php/doctrinephp.ts new file mode 100644 index 00000000..ef0befc2 --- /dev/null +++ b/src/rules/php/doctrinephp.ts @@ -0,0 +1,11 @@ +import { register } from '../../register.js'; + +register({ + tech: 'doctrinephp', + name: 'Doctrine', + type: 'tool', + files: ['artisan'], + dependencies: [ + { type: 'php', name: 'doctrine/orm', example: 'doctrine/lexer' }, + ], +}); diff --git a/src/rules/php/index.ts b/src/rules/php/index.ts new file mode 100644 index 00000000..9a5439a8 --- /dev/null +++ b/src/rules/php/index.ts @@ -0,0 +1,5 @@ +import './doctrinephp.js'; +import './laravel.js'; +import './phpunit.js'; +import './symfony.js'; +import './twig.js'; diff --git a/src/rules/php/laravel.ts b/src/rules/php/laravel.ts new file mode 100644 index 00000000..73804ccc --- /dev/null +++ b/src/rules/php/laravel.ts @@ -0,0 +1,9 @@ +import { register } from '../../register.js'; + +register({ + tech: 'laravel', + name: 'Laravel', + type: 'tool', + files: ['artisan'], + dependencies: [{ type: 'php', name: 'laravel/framework' }], +}); diff --git a/src/rules/php/phpunit.ts b/src/rules/php/phpunit.ts new file mode 100644 index 00000000..15e79ff4 --- /dev/null +++ b/src/rules/php/phpunit.ts @@ -0,0 +1,9 @@ +import { register } from '../../register.js'; + +register({ + tech: 'phpunit', + name: 'PHPUnit', + type: 'tool', + files: ['phpunit.xml.dist'], + dependencies: [{ type: 'php', name: 'phpunit/phpunit' }], +}); diff --git a/src/rules/php/symfony.ts b/src/rules/php/symfony.ts new file mode 100644 index 00000000..9efd0365 --- /dev/null +++ b/src/rules/php/symfony.ts @@ -0,0 +1,9 @@ +import { register } from '../../register.js'; + +register({ + tech: 'symfony', + name: 'Symfony', + type: 'tool', + files: ['artisan'], + dependencies: [{ type: 'php', name: /^symfony\//, example: 'symfony/yaml' }], +}); diff --git a/src/rules/php/twig.ts b/src/rules/php/twig.ts new file mode 100644 index 00000000..8d53c104 --- /dev/null +++ b/src/rules/php/twig.ts @@ -0,0 +1,8 @@ +import { register } from '../../register.js'; + +register({ + tech: 'twigphp', + name: 'Twig', + type: 'tool', + dependencies: [{ type: 'php', name: 'twig/twig' }], +}); diff --git a/src/rules/saas/algolia.ts b/src/rules/saas/algolia.ts index 464e4ae5..944a405c 100644 --- a/src/rules/saas/algolia.ts +++ b/src/rules/saas/algolia.ts @@ -18,5 +18,6 @@ register({ { type: 'rust', name: 'algoliasearch' }, { type: 'ruby', name: 'algolia' }, { type: 'ruby', name: 'algoliasearch-rails' }, + { type: 'php', name: 'algolia/algoliasearch-client-php' }, ], }); diff --git a/src/rules/saas/github.ts b/src/rules/saas/github.ts index ffa19275..edd08872 100644 --- a/src/rules/saas/github.ts +++ b/src/rules/saas/github.ts @@ -2,7 +2,7 @@ import { register } from '../../register.js'; register({ tech: 'github', - name: 'Github', + name: 'GitHub', type: 'saas', files: ['.github'], dependencies: [ diff --git a/src/rules/spec/docker/__snapshots__/component.test.ts.snap b/src/rules/spec/docker/__snapshots__/component.test.ts.snap index 073211eb..749db0f7 100644 --- a/src/rules/spec/docker/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/docker/__snapshots__/component.test.ts.snap @@ -37,6 +37,7 @@ exports[`docker > should match everything 1`] = ` "nginx", "nodejs", "percona", + "php", "plausible", "postgresql", "rabbitmq", @@ -219,6 +220,11 @@ exports[`docker > should match everything 2`] = ` "percona", "0.0.0", ], + [ + "docker", + "php", + "0.0.0", + ], [ "docker", "plausible/analytics", diff --git a/src/rules/spec/index.ts b/src/rules/spec/index.ts index 943d3b06..71059678 100644 --- a/src/rules/spec/index.ts +++ b/src/rules/spec/index.ts @@ -2,6 +2,7 @@ import './deno/index.js'; import './docker/index.js'; import './golang/index.js'; import './nodejs/index.js'; +import './php/index.js'; import './ruby/index.js'; import './rust/index.js'; import './terraform/index.js'; diff --git a/src/rules/spec/php/__snapshots__/component.test.ts.snap b/src/rules/spec/php/__snapshots__/component.test.ts.snap new file mode 100644 index 00000000..40db87c5 --- /dev/null +++ b/src/rules/spec/php/__snapshots__/component.test.ts.snap @@ -0,0 +1,183 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`php > should match everything 1`] = ` +[ + "algolia", + "amplitude", + "aws", + "firebase", + "firebase.firestore", + "gcp", + "gcp.aiplatform", + "gcp.bigquery", + "gcp.bigtable", + "gcp.cloudbuild", + "gcp.cloudrun", + "gcp.dataproc", + "gcp.datastore", + "gcp.functions", + "gcp.gce", + "gcp.gcs", + "gcp.language", + "gcp.pubsub", + "gcp.secretmanager", + "gcp.speech", + "gcp.sql", + "gcp.translate", + "gcp.vision", + "googleanalytics", + "mixpanel", + "php", + "redis", +] +`; + +exports[`php > should match everything 2`] = ` +[ + [ + "php", + "algolia/algoliasearch-client-php", + "0.0.0", + ], + [ + "php", + "aws/aws-sdk-php", + "0.0.0", + ], + [ + "php", + "google/analytics-admin", + "0.0.0", + ], + [ + "php", + "google/analytics-data", + "0.0.0", + ], + [ + "php", + "google/cloud", + "0.0.0", + ], + [ + "php", + "google/cloud-ai-platform", + "0.0.0", + ], + [ + "php", + "google/cloud-bigquery", + "0.0.0", + ], + [ + "php", + "google/cloud-bigtable", + "0.0.0", + ], + [ + "php", + "google/cloud-build", + "0.0.0", + ], + [ + "php", + "google/cloud-compute", + "0.0.0", + ], + [ + "php", + "google/cloud-dataproc", + "0.0.0", + ], + [ + "php", + "google/cloud-datastore", + "0.0.0", + ], + [ + "php", + "google/cloud-firestore", + "0.0.0", + ], + [ + "php", + "google/cloud-functions", + "0.0.0", + ], + [ + "php", + "google/cloud-functions-framework", + "0.0.0", + ], + [ + "php", + "google/cloud-language", + "0.0.0", + ], + [ + "php", + "google/cloud-pubsub", + "0.0.0", + ], + [ + "php", + "google/cloud-run", + "0.0.0", + ], + [ + "php", + "google/cloud-secret-manager", + "0.0.0", + ], + [ + "php", + "google/cloud-speech", + "0.0.0", + ], + [ + "php", + "google/cloud-sql-admin", + "0.0.0", + ], + [ + "php", + "google/cloud-storage", + "0.0.0", + ], + [ + "php", + "google/cloud-translate", + "0.0.0", + ], + [ + "php", + "google/cloud-vision", + "0.0.0", + ], + [ + "php", + "mixpanel/mixpanel-php", + "0.0.0", + ], + [ + "php", + "predis/predis", + "0.0.0", + ], + [ + "php", + "spatie/laravel-analytics", + "0.0.0", + ], + [ + "php", + "theiconic/php-ga-measurement-protocol", + "0.0.0", + ], + [ + "php", + "zumba/amplitude-php", + "0.0.0", + ], +] +`; diff --git a/src/rules/spec/php/component.test.ts b/src/rules/spec/php/component.test.ts new file mode 100644 index 00000000..8958ee01 --- /dev/null +++ b/src/rules/spec/php/component.test.ts @@ -0,0 +1,59 @@ +import { describe, expect, it } from 'vitest'; + +import { analyser } from '../../../analyser/index.js'; +import type { AllowedKeys } from '../../../index.js'; +import { rawList } from '../../../loader.js'; +import { flatten } from '../../../payload/helpers.js'; +import { FakeProvider } from '../../../provider/fake.js'; + +import '../../../autoload.js'; +import type { ComposerJson } from './component.js'; + +describe('php', () => { + it('should match everything', async () => { + const dependencies: Record = {}; + for (const item of rawList) { + if (item.type !== 'dependency' || item.ref.type !== 'php') { + continue; + } + dependencies['example' in item.ref ? item.ref.example : item.ref.name] = + '0.0.0'; + } + const composerJson: ComposerJson = { + name: 'test', + 'require-dev': dependencies, + }; + + const res = await analyser({ + provider: new FakeProvider({ + paths: { + '/': ['composer.json'], + }, + files: { + '/composer.json': JSON.stringify(composerJson), + }, + }), + }); + + const merged = flatten(res, { merge: true }); + expect(Array.from(merged.techs).sort()).toMatchSnapshot(); + expect(Array.from(merged.dependencies).sort()).toMatchSnapshot(); + }); + + it('should match nothing', async () => { + const res = await analyser({ + provider: new FakeProvider({ + paths: { + '/': ['composer.json'], + }, + files: { + '/composer.json': JSON.stringify({ foo: 'bar' }), + }, + }), + }); + const match: AllowedKeys[] = ['php']; + expect( + Array.from(flatten(res, { merge: true }).techs).sort() + ).toStrictEqual(match); + }); +}); diff --git a/src/rules/spec/php/component.ts b/src/rules/spec/php/component.ts new file mode 100644 index 00000000..c39b12aa --- /dev/null +++ b/src/rules/spec/php/component.ts @@ -0,0 +1,60 @@ +import { l } from '../../../common/log.js'; +import { matchDependencies } from '../../../matchDependencies.js'; +import { Payload } from '../../../payload/index.js'; +import type { Analyser } from '../../../types/index.js'; +import type { ComponentMatcher } from '../../../types/rule.js'; + +const FILES = ['composer.json']; + +export interface ComposerJson { + name: string; + require?: Record; + 'require-dev'?: Record; +} + +export const detectPhpComponent: ComponentMatcher = async (files, provider) => { + for (const file of files) { + if (!FILES.includes(file.name)) { + continue; + } + + const content = await provider.open(file.fp); + if (!content) { + continue; + } + + let json: ComposerJson; + try { + json = JSON.parse(content); + } catch (e) { + l.warn('Failed to parse composer.json', file.fp, e); + return false; + } + + if (!json.name) { + return false; + } + + const deps = { + ...(json.require || {}), + ...(json['require-dev'] || {}), + }; + const techs = matchDependencies(Object.keys(deps), 'php'); + const depsFlatten: Analyser['dependencies'] = Object.entries(deps).map( + (dep: [string, string]) => { + return ['php', dep[0], dep[1]]; + } + ); + + const pl = new Payload({ + name: json.name, + folderPath: file.fp, + dependencies: depsFlatten, + }); + pl.addTechs(techs); + + return pl; + } + + return false; +}; diff --git a/src/rules/spec/php/index.ts b/src/rules/spec/php/index.ts new file mode 100644 index 00000000..ed93b5ee --- /dev/null +++ b/src/rules/spec/php/index.ts @@ -0,0 +1,12 @@ +import { register } from '../../../register.js'; + +import { detectPhpComponent } from './component.js'; + +register({ + tech: 'php', + name: 'PHP', + type: 'language', + files: ['composer.json', 'composer.lock', 'phpunit.xml.dist'], + dependencies: [{ type: 'docker', name: 'php', example: 'php:0.0.0' }], + detect: detectPhpComponent, +}); diff --git a/src/rules/spec/ruby/__snapshots__/component.test.ts.snap b/src/rules/spec/ruby/__snapshots__/lockfile.test.ts.snap similarity index 100% rename from src/rules/spec/ruby/__snapshots__/component.test.ts.snap rename to src/rules/spec/ruby/__snapshots__/lockfile.test.ts.snap diff --git a/src/rules/spec/ruby/index.ts b/src/rules/spec/ruby/index.ts index 3cc134ea..0f1cdfaa 100644 --- a/src/rules/spec/ruby/index.ts +++ b/src/rules/spec/ruby/index.ts @@ -1,6 +1,6 @@ import { register } from '../../../register.js'; -import { detectRubyComponent } from './component.js'; +import { detectRubyLockfile } from './lockfile.js'; register({ tech: 'ruby', @@ -8,5 +8,5 @@ register({ type: 'language', files: ['Gemfile', 'Rakefile', '.ruby-version'], dependencies: [{ type: 'docker', name: /ruby/, example: 'ruby:0.0.0' }], - detect: detectRubyComponent, + detect: detectRubyLockfile, }); diff --git a/src/rules/spec/ruby/component.test.ts b/src/rules/spec/ruby/lockfile.test.ts similarity index 100% rename from src/rules/spec/ruby/component.test.ts rename to src/rules/spec/ruby/lockfile.test.ts diff --git a/src/rules/spec/ruby/component.ts b/src/rules/spec/ruby/lockfile.ts similarity index 93% rename from src/rules/spec/ruby/component.ts rename to src/rules/spec/ruby/lockfile.ts index 96d25bc7..77127b4e 100644 --- a/src/rules/spec/ruby/component.ts +++ b/src/rules/spec/ruby/lockfile.ts @@ -8,10 +8,7 @@ const FILES = ['Gemfile']; const NEW_LINE_REG = /\r?\n/; const DEP_REG = /gem "(.+)",\s+("(.+)")?/; -export const detectRubyComponent: ComponentMatcher = async ( - files, - provider -) => { +export const detectRubyLockfile: ComponentMatcher = async (files, provider) => { for (const file of files) { if (!FILES.includes(file.name)) { continue; diff --git a/src/rules/storage/gcp.gcs.ts b/src/rules/storage/gcp.gcs.ts index 29bdd979..d3adf09d 100644 --- a/src/rules/storage/gcp.gcs.ts +++ b/src/rules/storage/gcp.gcs.ts @@ -10,5 +10,6 @@ register({ { type: 'golang', name: 'cloud.google.com/go/storage' }, { type: 'ruby', name: 'google-cloud-storage' }, { type: 'rust', name: 'google-cloud-storage' }, + { type: 'php', name: 'google/cloud-storage' }, ], }); diff --git a/src/rules/tool/gcp.cloudbuild.ts b/src/rules/tool/gcp.cloudbuild.ts index 06464ae3..13a92c34 100644 --- a/src/rules/tool/gcp.cloudbuild.ts +++ b/src/rules/tool/gcp.cloudbuild.ts @@ -13,5 +13,6 @@ register({ example: 'google-cloud-build-v1', }, { type: 'golang', name: 'cloud.google.com/go/cloudbuild' }, + { type: 'php', name: 'google/cloud-build' }, ], }); diff --git a/src/types/rule.ts b/src/types/rule.ts index a7d3e2bd..7271e458 100644 --- a/src/types/rule.ts +++ b/src/types/rule.ts @@ -8,6 +8,7 @@ export type SupportedDeps = | 'docker' | 'golang' | 'npm' + | 'php' | 'ruby' | 'rust' | 'terraform.resource' diff --git a/src/types/techs.ts b/src/types/techs.ts index fa7d4367..76574ca4 100644 --- a/src/types/techs.ts +++ b/src/types/techs.ts @@ -81,6 +81,7 @@ export type AllowedKeys = | 'discord' | 'discourse' | 'docker' + | 'doctrinephp' | 'docusign' | 'dropbox' | 'dynatrace' @@ -152,6 +153,7 @@ export type AllowedKeys = | 'koa' | 'kotlin' | 'kubernetes' + | 'laravel' | 'launchdarkly' | 'logrocket' | 'logsnag' @@ -180,6 +182,7 @@ export type AllowedKeys = | 'pagerduty' | 'percona' | 'php' + | 'phpunit' | 'pingdom' | 'placekit' | 'planetscale' @@ -238,6 +241,7 @@ export type AllowedKeys = | 'supabase' | 'sveltejs' | 'swift' + | 'symfony' | 'tailwind' | 'teamcity' | 'tencentcloud' @@ -246,6 +250,7 @@ export type AllowedKeys = | 'tinybird' | 'traefik' | 'travisci' + | 'twigphp' | 'twilio' | 'twitter' | 'typescript' diff --git a/tests/__fixtures__/php/composer.json b/tests/__fixtures__/php/composer.json new file mode 100644 index 00000000..cdcb228c --- /dev/null +++ b/tests/__fixtures__/php/composer.json @@ -0,0 +1,79 @@ +{ + "name": "symfony/translation", + "type": "library", + "description": "Provides tools to internationalize your application", + "keywords": [], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "mockery/mockery": "~1.0", + "phpunit/phpunit": "^9.0", + "php-mock/php-mock-mockery": "^1.3", + "dms/phpunit-arraysubset-asserts": "^0.2.1", + "fakerphp/faker": "^1.13", + "slevomat/coding-standard": "^7.0", + "nunomaduro/larastan": "^2.1", + "laravel/tinker": "^2.7" + }, + "require-dev": { + "php": ">=8.0", + "laravel/framework": "^9.0", + "james-heinrich/getid3": "^1.9", + "guzzlehttp/guzzle": "^7.0.1", + "aws/aws-sdk-php-laravel": "^3.1", + "pusher/pusher-php-server": "^4.0", + "predis/predis": "~1.0", + "jackiedo/dotenv-editor": "^2.0", + "ext-exif": "*", + "ext-gd": "*", + "ext-fileinfo": "*", + "ext-json": "*", + "ext-SimpleXML": "*", + "daverandom/resume": "^0.0.3", + "laravel/helpers": "^1.0", + "intervention/image": "^2.5", + "doctrine/dbal": "^3.0", + "lstrojny/functional-php": "^1.14", + "teamtnt/laravel-scout-tntsearch-driver": "^11.1", + "algolia/algoliasearch-client-php": "^3.3", + "laravel/ui": "^3.2", + "webmozart/assert": "^1.10", + "laravel/sanctum": "^2.15", + "laravel/scout": "^9.4", + "nunomaduro/collision": "^6.2", + "jwilsson/spotify-web-api-php": "^5.2", + "meilisearch/meilisearch-php": "^0.24.0", + "http-interop/http-factory-guzzle": "^1.2" + }, + "provide": { + "symfony/translation-implementation": "2.3|3.0" + }, + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev", + "scripts": { + "post-autoload-dump": [ + "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", + "@php artisan package:discover" + ] + } +} From 7d3968ffc727ae7e0f234cd20203e534c221f5e2 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Thu, 7 Sep 2023 18:59:07 +0200 Subject: [PATCH 2/3] add more pkgs --- src/analyser/__snapshots__/index.test.ts.snap | 8 + src/rules/__snapshots__/index.test.ts.snap | 7 + src/rules/app/zookeeper.ts | 1 + src/rules/db/apache_couchdb.ts | 5 +- src/rules/db/aws.dynamodb.ts | 2 + src/rules/db/aws.elasticache.ts | 1 + src/rules/db/aws.rds.ts | 1 + src/rules/db/clickhouse.ts | 1 + src/rules/db/cockroachdb.ts | 1 + src/rules/db/couchbase.ts | 1 + src/rules/db/datastax.ts | 1 + src/rules/db/elasticsearch.ts | 1 + src/rules/db/hashicorp_vault.ts | 1 + src/rules/db/influxdb.ts | 1 + src/rules/db/mongodb.ts | 1 + src/rules/db/postgres.ts | 1 + src/rules/db/redis.ts | 2 + src/rules/hosting/alibabacloud.ts | 2 + src/rules/hosting/aws.lambda.ts | 1 + src/rules/hosting/cloudflare.ts | 1 + src/rules/hosting/fastly.ts | 1 + src/rules/hosting/heroku.ts | 1 + src/rules/hosting/kubernetes.ts | 1 + src/rules/hosting/oraclecloud.ts | 1 + src/rules/hosting/ovh.ts | 1 + src/rules/hosting/tencentcloud.ts | 1 + src/rules/index.ts | 1 + src/rules/messaging/apache_kafka.ts | 2 + src/rules/messaging/aws.sns.ts | 2 + src/rules/messaging/aws.sqs.ts | 1 + src/rules/messaging/rabbitmq.ts | 1 + src/rules/php/index.ts | 2 + src/rules/php/magento.ts | 12 + src/rules/php/wordpress.ts | 12 + src/rules/saas/airtable.ts | 5 +- src/rules/saas/algolia.ts | 1 + src/rules/saas/auth0.ts | 2 + src/rules/saas/bigcommerce.ts | 1 + src/rules/saas/bitbucket.ts | 1 + src/rules/saas/contentful.ts | 6 + src/rules/saas/crowdin.ts | 1 + src/rules/saas/datadog.ts | 2 + src/rules/saas/docusign.ts | 1 + src/rules/saas/dropbox.ts | 1 + src/rules/saas/github.ts | 1 + src/rules/saas/hubspot.ts | 2 + src/rules/saas/klaviyo.ts | 1 + src/rules/saas/launchdarkly.ts | 2 + src/rules/saas/mailchimp.ts | 3 + src/rules/saas/mailjet.ts | 2 + src/rules/saas/newrelic.ts | 2 + src/rules/saas/okta.ts | 1 + src/rules/saas/openai.ts | 6 +- src/rules/saas/pagerduty.ts | 1 + src/rules/saas/resend.ts | 5 +- src/rules/saas/sendgrid.ts | 1 + src/rules/saas/sentry.ts | 4 + src/rules/saas/shopify.ts | 2 + src/rules/saas/slack.ts | 1 + src/rules/saas/squareup.ts | 1 + src/rules/saas/stripe.ts | 8 +- src/rules/saas/twilio.ts | 1 + .../__snapshots__/component.test.ts.snap | 16 + .../php/__snapshots__/component.test.ts.snap | 516 ++++++++++++++++++ src/rules/storage/aws.s3.ts | 2 + src/rules/tool/gitlab.ts | 1 + src/types/techs.ts | 2 + 67 files changed, 676 insertions(+), 5 deletions(-) create mode 100644 src/rules/php/magento.ts create mode 100644 src/rules/php/wordpress.ts diff --git a/src/analyser/__snapshots__/index.test.ts.snap b/src/analyser/__snapshots__/index.test.ts.snap index 61d60358..7652cfca 100644 --- a/src/analyser/__snapshots__/index.test.ts.snap +++ b/src/analyser/__snapshots__/index.test.ts.snap @@ -623,6 +623,8 @@ exports[`analyser > should run correctly 1`] = ` "/php/composer.json", ], "reason": [ + "phpunit matched: /^phpunit\\\\/phpunit$/", + "laravel matched: /^laravel\\\\/framework$/", "redis matched: /^predis\\\\/predis$/", "algolia matched: /^algolia\\\\/algoliasearch-client-php$/", "matched file: composer.json", @@ -630,7 +632,9 @@ exports[`analyser > should run correctly 1`] = ` "tech": null, "techs": [ "algolia", + "laravel", "php", + "phpunit", "redis", ], }, @@ -1363,7 +1367,9 @@ exports[`analyser > should run correctly 2`] = ` "tech": null, "techs": [ "algolia", + "laravel", "php", + "phpunit", "redis", ], }, @@ -1718,8 +1724,10 @@ exports[`analyser > should run correctly 2`] = ` "fastify", "gcp", "golang", + "laravel", "nodejs", "php", + "phpunit", "postgresql", "prettier", "prisma", diff --git a/src/rules/__snapshots__/index.test.ts.snap b/src/rules/__snapshots__/index.test.ts.snap index 7b07a168..802c0343 100644 --- a/src/rules/__snapshots__/index.test.ts.snap +++ b/src/rules/__snapshots__/index.test.ts.snap @@ -63,6 +63,7 @@ exports[`all > should match everything 1`] = ` "discord", "discourse", "docker", + "doctrinephp", "docusign", "dropbox", "dynatrace", @@ -126,9 +127,11 @@ exports[`all > should match everything 1`] = ` "klaviyo", "koa", "kubernetes", + "laravel", "launchdarkly", "logrocket", "logsnag", + "magento", "mailchimp", "mailjet", "mariadb", @@ -154,6 +157,7 @@ exports[`all > should match everything 1`] = ` "pagerduty", "percona", "php", + "phpunit", "pingdom", "placekit", "planetscale", @@ -207,6 +211,7 @@ exports[`all > should match everything 1`] = ` "supabase.postgres", "supabase.storage", "sveltejs", + "symfony", "tailwind", "teamcity", "tencentcloud", @@ -214,6 +219,7 @@ exports[`all > should match everything 1`] = ` "terragrunt", "tinybird", "travisci", + "twigphp", "twilio", "twitter", "typescript", @@ -232,6 +238,7 @@ exports[`all > should match everything 1`] = ` "webflow", "webpack", "wiz", + "wordpress", "zapier", "zendesk", "zookeeper", diff --git a/src/rules/app/zookeeper.ts b/src/rules/app/zookeeper.ts index 8bf4650e..80e28802 100644 --- a/src/rules/app/zookeeper.ts +++ b/src/rules/app/zookeeper.ts @@ -8,5 +8,6 @@ register({ { type: 'docker', name: /zookeeper/, example: 'zookeeper:0.0.0' }, { type: 'rust', name: 'zookeeper' }, { type: 'ruby', name: 'zookeeper' }, + { type: 'php', name: 'sparkinfluence/zookeeper' }, ], }); diff --git a/src/rules/db/apache_couchdb.ts b/src/rules/db/apache_couchdb.ts index 8377f30e..13dfb4cd 100644 --- a/src/rules/db/apache_couchdb.ts +++ b/src/rules/db/apache_couchdb.ts @@ -4,5 +4,8 @@ register({ tech: 'apache_couchdb', name: 'Apache CouchDB', type: 'db', - dependencies: [{ type: 'docker', name: 'apache/couchdb' }], + dependencies: [ + { type: 'docker', name: 'apache/couchdb' }, + { type: 'php', name: 'doctrine/couchdb' }, + ], }); diff --git a/src/rules/db/aws.dynamodb.ts b/src/rules/db/aws.dynamodb.ts index afcab5cc..7a799eb2 100644 --- a/src/rules/db/aws.dynamodb.ts +++ b/src/rules/db/aws.dynamodb.ts @@ -30,5 +30,7 @@ register({ name: /^aws_dynamodb/, example: 'aws_dynamodb_table', }, + { type: 'php', name: 'baopham/dynamodb' }, + { type: 'php', name: 'async-aws/dynamo-db' }, ], }); diff --git a/src/rules/db/aws.elasticache.ts b/src/rules/db/aws.elasticache.ts index d1488f06..feda6445 100644 --- a/src/rules/db/aws.elasticache.ts +++ b/src/rules/db/aws.elasticache.ts @@ -17,5 +17,6 @@ register({ name: /^aws_elasticache/, example: 'aws_elasticache_cluster', }, + { type: 'php', name: 'atyagi/elasticache-laravel' }, ], }); diff --git a/src/rules/db/aws.rds.ts b/src/rules/db/aws.rds.ts index d07cfc92..da709e29 100644 --- a/src/rules/db/aws.rds.ts +++ b/src/rules/db/aws.rds.ts @@ -15,5 +15,6 @@ register({ name: /^aws_rds/, example: 'aws_rds_cluster', }, + { type: 'php', name: 'async-aws/rds-data-service' }, ], }); diff --git a/src/rules/db/clickhouse.ts b/src/rules/db/clickhouse.ts index beee4860..46773cb5 100644 --- a/src/rules/db/clickhouse.ts +++ b/src/rules/db/clickhouse.ts @@ -12,5 +12,6 @@ register({ type: 'terraform', name: 'registry.terraform.io/ClickHouse/clickhouse', }, + { type: 'php', name: 'smi2/phpclickhouse' }, ], }); diff --git a/src/rules/db/cockroachdb.ts b/src/rules/db/cockroachdb.ts index 44e834de..73eadb8a 100644 --- a/src/rules/db/cockroachdb.ts +++ b/src/rules/db/cockroachdb.ts @@ -9,5 +9,6 @@ register({ type: 'terraform', name: 'registry.terraform.io/cockroachdb/cockroach', }, + { type: 'php', name: 'nbj/cockroachdb-laravel' }, ], }); diff --git a/src/rules/db/couchbase.ts b/src/rules/db/couchbase.ts index 4c9c45cc..ca0bb847 100644 --- a/src/rules/db/couchbase.ts +++ b/src/rules/db/couchbase.ts @@ -13,5 +13,6 @@ register({ type: 'terraform', name: 'registry.terraform.io/couchbasecloud/couchbasecapella', }, + { type: 'php', name: 'couchbase/couchbase' }, ], }); diff --git a/src/rules/db/datastax.ts b/src/rules/db/datastax.ts index 048c90b0..4ac23501 100644 --- a/src/rules/db/datastax.ts +++ b/src/rules/db/datastax.ts @@ -9,5 +9,6 @@ register({ type: 'terraform', name: 'registry.terraform.io/datastax/astra', }, + { type: 'php', name: 'datastax/php-driver' }, ], }); diff --git a/src/rules/db/elasticsearch.ts b/src/rules/db/elasticsearch.ts index d64d726f..3f5f6c5d 100644 --- a/src/rules/db/elasticsearch.ts +++ b/src/rules/db/elasticsearch.ts @@ -15,5 +15,6 @@ register({ { type: 'rust', name: 'aws-sdk-elasticsearch' }, { type: 'ruby', name: 'elasticsearch' }, { type: 'ruby', name: 'aws-sdk-elasticsearchservice' }, + { type: 'php', name: 'elasticsearch/elasticsearch' }, ], }); diff --git a/src/rules/db/hashicorp_vault.ts b/src/rules/db/hashicorp_vault.ts index 8ebfd908..7fb3f158 100644 --- a/src/rules/db/hashicorp_vault.ts +++ b/src/rules/db/hashicorp_vault.ts @@ -9,5 +9,6 @@ register({ { type: 'terraform', name: 'registry.terraform.io/hashicorp/vault' }, { type: 'rust', name: 'hashicorp_vault' }, { type: 'ruby', name: 'vault' }, + { type: 'php', name: 'csharpru/vault-php' }, ], }); diff --git a/src/rules/db/influxdb.ts b/src/rules/db/influxdb.ts index 957eaab2..075579bf 100644 --- a/src/rules/db/influxdb.ts +++ b/src/rules/db/influxdb.ts @@ -10,5 +10,6 @@ register({ { type: 'rust', name: 'influxdb' }, { type: 'rust', name: 'influxdb2' }, { type: 'ruby', name: 'influxdb-client' }, + { type: 'php', name: 'influxdata/influxdb-client-php' }, ], }); diff --git a/src/rules/db/mongodb.ts b/src/rules/db/mongodb.ts index 6be3de93..86cadfe4 100644 --- a/src/rules/db/mongodb.ts +++ b/src/rules/db/mongodb.ts @@ -10,5 +10,6 @@ register({ { type: 'docker', name: /mongo/, example: 'mongo:0.0.0' }, { type: 'rust', name: 'mongodb' }, { type: 'ruby', name: 'mongo' }, + { type: 'php', name: 'mongodb/mongodb' }, ], }); diff --git a/src/rules/db/postgres.ts b/src/rules/db/postgres.ts index aa7603ae..7eabc637 100644 --- a/src/rules/db/postgres.ts +++ b/src/rules/db/postgres.ts @@ -14,5 +14,6 @@ register({ name: /\/x\/postgres@/, example: 'https://deno.land/x/postgres@v0.17.0/mod.ts', }, + { type: 'php', name: 'martin-georgiev/postgresql-for-doctrine' }, ], }); diff --git a/src/rules/db/redis.ts b/src/rules/db/redis.ts index d2419045..5728ddfa 100644 --- a/src/rules/db/redis.ts +++ b/src/rules/db/redis.ts @@ -13,5 +13,7 @@ register({ { type: 'ruby', name: 'redis' }, { type: 'ruby', name: 'redis-client' }, { type: 'php', name: 'predis/predis' }, + { type: 'php', name: 'snc/redis-bundle' }, + { type: 'php', name: 'colinmollenhour/cache-backend-redis' }, ], }); diff --git a/src/rules/hosting/alibabacloud.ts b/src/rules/hosting/alibabacloud.ts index 9fca091f..69897a40 100644 --- a/src/rules/hosting/alibabacloud.ts +++ b/src/rules/hosting/alibabacloud.ts @@ -6,5 +6,7 @@ register({ type: 'hosting', dependencies: [ { type: 'terraform', name: 'registry.terraform.io/aliyun/alicloud' }, + { type: 'php', name: 'alibabacloud/sdk' }, + { type: 'php', name: 'alibabacloud/client' }, ], }); diff --git a/src/rules/hosting/aws.lambda.ts b/src/rules/hosting/aws.lambda.ts index 012df1c1..8eedee07 100644 --- a/src/rules/hosting/aws.lambda.ts +++ b/src/rules/hosting/aws.lambda.ts @@ -21,5 +21,6 @@ register({ name: /^aws_lambda/, example: 'aws_lambda_alias', }, + { type: 'php', name: 'async-aws/lambda' }, ], }); diff --git a/src/rules/hosting/cloudflare.ts b/src/rules/hosting/cloudflare.ts index 17c6e0f7..1133a50d 100644 --- a/src/rules/hosting/cloudflare.ts +++ b/src/rules/hosting/cloudflare.ts @@ -13,5 +13,6 @@ register({ { type: 'terraform', name: 'registry.terraform.io/cloudflare/cloudflare' }, { type: 'rust', name: 'cloudflare' }, { type: 'ruby', name: 'cloudflare-rails' }, + { type: 'php', name: 'cloudflare/sdk' }, ], }); diff --git a/src/rules/hosting/fastly.ts b/src/rules/hosting/fastly.ts index 644f9e25..7ab2a577 100644 --- a/src/rules/hosting/fastly.ts +++ b/src/rules/hosting/fastly.ts @@ -16,5 +16,6 @@ register({ name: /^@fastly\//, example: '@fastly/performance-observer-polyfill', }, + { type: 'npm', name: 'fastly/fastly' }, ], }); diff --git a/src/rules/hosting/heroku.ts b/src/rules/hosting/heroku.ts index ac67f0ce..e9ede30d 100644 --- a/src/rules/hosting/heroku.ts +++ b/src/rules/hosting/heroku.ts @@ -8,5 +8,6 @@ register({ dependencies: [ { type: 'terraform', name: 'registry.terraform.io/heroku/heroku' }, { type: 'ruby', name: 'platform-api' }, + { type: 'php', name: 'heroku/heroku-buildpack-php' }, ], }); diff --git a/src/rules/hosting/kubernetes.ts b/src/rules/hosting/kubernetes.ts index f9fa5384..dbb4d375 100644 --- a/src/rules/hosting/kubernetes.ts +++ b/src/rules/hosting/kubernetes.ts @@ -9,5 +9,6 @@ register({ { type: 'rust', name: 'k8s-openapi' }, { type: 'ruby', name: 'kubeclient' }, { type: 'npm', name: '@kubernetes/client-node' }, + { type: 'php', name: 'kubernetes/php-client' }, ], }); diff --git a/src/rules/hosting/oraclecloud.ts b/src/rules/hosting/oraclecloud.ts index 6bb274b9..c8cd487e 100644 --- a/src/rules/hosting/oraclecloud.ts +++ b/src/rules/hosting/oraclecloud.ts @@ -8,5 +8,6 @@ register({ { type: 'npm', name: /^oci-/, example: 'oci-sdk' }, { type: 'terraform', name: 'registry.terraform.io/oracle/oci' }, { type: 'ruby', name: 'oci' }, + { type: 'php', name: 'oracle/oci-php-sdk' }, ], }); diff --git a/src/rules/hosting/ovh.ts b/src/rules/hosting/ovh.ts index 6239d643..5a68fed6 100644 --- a/src/rules/hosting/ovh.ts +++ b/src/rules/hosting/ovh.ts @@ -10,5 +10,6 @@ register({ type: 'npm', name: '@ovh-api/api', }, + { type: 'php', name: 'ovh/ovh' }, ], }); diff --git a/src/rules/hosting/tencentcloud.ts b/src/rules/hosting/tencentcloud.ts index 554ba8db..9d952793 100644 --- a/src/rules/hosting/tencentcloud.ts +++ b/src/rules/hosting/tencentcloud.ts @@ -9,5 +9,6 @@ register({ type: 'terraform', name: 'registry.terraform.io/tencentcloudstack/tencentcloud', }, + { type: 'php', name: 'encentcloud/tencentcloud-sdk-php' }, ], }); diff --git a/src/rules/index.ts b/src/rules/index.ts index 5e764c5c..a73dd311 100644 --- a/src/rules/index.ts +++ b/src/rules/index.ts @@ -8,6 +8,7 @@ import './hosting/index.js'; import './js/index.js'; import './messaging/index.js'; import './network/index.js'; +import './php/index.js'; import './saas/index.js'; import './spec/index.js'; import './storage/index.js'; diff --git a/src/rules/messaging/apache_kafka.ts b/src/rules/messaging/apache_kafka.ts index 1827b2e7..b8eb6eac 100644 --- a/src/rules/messaging/apache_kafka.ts +++ b/src/rules/messaging/apache_kafka.ts @@ -7,5 +7,7 @@ register({ dependencies: [ { type: 'docker', name: 'bitnami/kafka' }, { type: 'terraform', name: 'registry.terraform.io/confluentinc/confluent' }, + { type: 'php', name: 'nmred/kafka-php' }, + { type: 'php', name: 'longlang/phpkafka' }, ], }); diff --git a/src/rules/messaging/aws.sns.ts b/src/rules/messaging/aws.sns.ts index 5c000644..24f9b1e3 100644 --- a/src/rules/messaging/aws.sns.ts +++ b/src/rules/messaging/aws.sns.ts @@ -14,5 +14,7 @@ register({ name: /^aws_sns/, example: 'aws_sns_topic', }, + { type: 'php', name: 'aws/aws-php-sns-message-validator' }, + { type: 'php', name: 'async-aws/sns' }, ], }); diff --git a/src/rules/messaging/aws.sqs.ts b/src/rules/messaging/aws.sqs.ts index 3bd9243d..c65c134e 100644 --- a/src/rules/messaging/aws.sqs.ts +++ b/src/rules/messaging/aws.sqs.ts @@ -14,5 +14,6 @@ register({ name: /^aws_sqs/, example: 'aws_sqs_queue', }, + { type: 'php', name: 'async-aws/sqs' }, ], }); diff --git a/src/rules/messaging/rabbitmq.ts b/src/rules/messaging/rabbitmq.ts index 8b313028..031a859e 100644 --- a/src/rules/messaging/rabbitmq.ts +++ b/src/rules/messaging/rabbitmq.ts @@ -9,5 +9,6 @@ register({ { type: 'docker', name: /rabbitmq/, example: 'rabbitmq:0.0.0' }, { type: 'rust', name: 'rabbitmq-stream-client' }, { type: 'ruby', name: 'bunny' }, + { type: 'php', name: 'php-amqplib/php-amqplib' }, ], }); diff --git a/src/rules/php/index.ts b/src/rules/php/index.ts index 9a5439a8..2cf902b1 100644 --- a/src/rules/php/index.ts +++ b/src/rules/php/index.ts @@ -1,5 +1,7 @@ import './doctrinephp.js'; import './laravel.js'; +import './magento.js'; import './phpunit.js'; import './symfony.js'; import './twig.js'; +import './wordpress.js'; diff --git a/src/rules/php/magento.ts b/src/rules/php/magento.ts new file mode 100644 index 00000000..c0863aa3 --- /dev/null +++ b/src/rules/php/magento.ts @@ -0,0 +1,12 @@ +import { register } from '../../register.js'; + +register({ + tech: 'magento', + name: 'Magento', + type: 'tool', + dependencies: [ + { type: 'php', name: 'magento/composer' }, + { type: 'php', name: 'fastly/magento2' }, + { type: 'php', name: 'smile/elasticsuite' }, + ], +}); diff --git a/src/rules/php/wordpress.ts b/src/rules/php/wordpress.ts new file mode 100644 index 00000000..c4343c2a --- /dev/null +++ b/src/rules/php/wordpress.ts @@ -0,0 +1,12 @@ +import { register } from '../../register.js'; + +register({ + tech: 'wordpress', + name: 'Wordpress', + type: 'tool', + dependencies: [ + { type: 'php', name: 'wp-cli/wp-cli' }, + { type: 'php', name: 'roots/wordpress' }, + { type: 'php', name: 'johnpbloch/wordpress' }, + ], +}); diff --git a/src/rules/saas/airtable.ts b/src/rules/saas/airtable.ts index df37a296..2a3736ea 100644 --- a/src/rules/saas/airtable.ts +++ b/src/rules/saas/airtable.ts @@ -4,5 +4,8 @@ register({ tech: 'airtable', name: 'Airtable', type: 'saas', - dependencies: [{ type: 'npm', name: 'airtable' }], + dependencies: [ + { type: 'npm', name: 'airtable' }, + { type: 'php', name: 'sleiman/airtable-php' }, + ], }); diff --git a/src/rules/saas/algolia.ts b/src/rules/saas/algolia.ts index 944a405c..6fdf4b5b 100644 --- a/src/rules/saas/algolia.ts +++ b/src/rules/saas/algolia.ts @@ -19,5 +19,6 @@ register({ { type: 'ruby', name: 'algolia' }, { type: 'ruby', name: 'algoliasearch-rails' }, { type: 'php', name: 'algolia/algoliasearch-client-php' }, + { type: 'php', name: 'algolia/scout-extended' }, ], }); diff --git a/src/rules/saas/auth0.ts b/src/rules/saas/auth0.ts index 4d65cf1a..b8ca83c6 100644 --- a/src/rules/saas/auth0.ts +++ b/src/rules/saas/auth0.ts @@ -11,5 +11,7 @@ register({ { type: 'rust', name: 'auth0' }, { type: 'ruby', name: 'auth0' }, { type: 'ruby', name: 'omniauth-auth0' }, + { type: 'php', name: 'auth0/auth0-php' }, + { type: 'php', name: 'auth0/login' }, ], }); diff --git a/src/rules/saas/bigcommerce.ts b/src/rules/saas/bigcommerce.ts index 849a42a7..83d26e34 100644 --- a/src/rules/saas/bigcommerce.ts +++ b/src/rules/saas/bigcommerce.ts @@ -4,4 +4,5 @@ register({ tech: 'bigcommerce', name: 'BigCommerce', type: 'saas', + dependencies: [{ type: 'php', name: 'bigcommerce/api' }], }); diff --git a/src/rules/saas/bitbucket.ts b/src/rules/saas/bitbucket.ts index 405b2d0a..f64e56d9 100644 --- a/src/rules/saas/bitbucket.ts +++ b/src/rules/saas/bitbucket.ts @@ -4,4 +4,5 @@ register({ tech: 'bitbucket', name: 'Bitbucket', type: 'saas', + dependencies: [{ type: 'php', name: 'bitbucket/client' }], }); diff --git a/src/rules/saas/contentful.ts b/src/rules/saas/contentful.ts index 5a156a0b..a1d14359 100644 --- a/src/rules/saas/contentful.ts +++ b/src/rules/saas/contentful.ts @@ -4,4 +4,10 @@ register({ tech: 'contenful', name: 'Contentful', type: 'saas', + dependencies: [ + { type: 'php', name: 'contentful/contentful' }, + { type: 'php', name: 'contentful/contentful-management' }, + { type: 'npm', name: 'contentful' }, + { type: 'npm', name: 'contentful-management' }, + ], }); diff --git a/src/rules/saas/crowdin.ts b/src/rules/saas/crowdin.ts index a0ca5d0f..1af74d54 100644 --- a/src/rules/saas/crowdin.ts +++ b/src/rules/saas/crowdin.ts @@ -11,5 +11,6 @@ register({ name: /^@crowdin\//, example: '@crowdin/crowdin-api-client', }, + { type: 'php', name: 'crowdin/crowdin-api-client' }, ], }); diff --git a/src/rules/saas/datadog.ts b/src/rules/saas/datadog.ts index 8177a410..f905b247 100644 --- a/src/rules/saas/datadog.ts +++ b/src/rules/saas/datadog.ts @@ -16,5 +16,7 @@ register({ { type: 'rust', name: 'datadog-apm' }, { type: 'ruby', name: 'ddtrace' }, { type: 'ruby', name: /datadog/, example: 'datadog-lambda' }, + { type: 'php', name: 'datadog/php-datadogstatsd' }, + { type: 'php', name: 'datadog/dd-trace' }, ], }); diff --git a/src/rules/saas/docusign.ts b/src/rules/saas/docusign.ts index 0fc6fe21..e23eebf6 100644 --- a/src/rules/saas/docusign.ts +++ b/src/rules/saas/docusign.ts @@ -7,5 +7,6 @@ register({ dependencies: [ { type: 'npm', name: 'docusign-esign' }, { type: 'ruby', name: 'docusign_esign' }, + { type: 'php', name: 'docusign/esign-client' }, ], }); diff --git a/src/rules/saas/dropbox.ts b/src/rules/saas/dropbox.ts index acfaabf2..edc6ae2e 100644 --- a/src/rules/saas/dropbox.ts +++ b/src/rules/saas/dropbox.ts @@ -4,4 +4,5 @@ register({ tech: 'dropbox', name: 'Dropbox', type: 'saas', + dependencies: [{ type: 'php', name: 'spatie/dropbox-api' }], }); diff --git a/src/rules/saas/github.ts b/src/rules/saas/github.ts index edd08872..1948b910 100644 --- a/src/rules/saas/github.ts +++ b/src/rules/saas/github.ts @@ -10,5 +10,6 @@ register({ { type: 'npm', name: /^@octokit\//, example: '@octokit/types' }, { type: 'terraform', name: 'registry.terraform.io/integrations/github' }, { type: 'ruby', name: 'octokit' }, + { type: 'php', name: 'knplabs/github-api' }, ], }); diff --git a/src/rules/saas/hubspot.ts b/src/rules/saas/hubspot.ts index 7d6559e5..13bc3ebe 100644 --- a/src/rules/saas/hubspot.ts +++ b/src/rules/saas/hubspot.ts @@ -6,5 +6,7 @@ register({ type: 'saas', dependencies: [ { type: 'npm', name: /^@hubpost\//, example: '@hubspot/api-client' }, + { type: 'php', name: 'hubspot/hubspot-php' }, + { type: 'php', name: 'hubspot/api-client' }, ], }); diff --git a/src/rules/saas/klaviyo.ts b/src/rules/saas/klaviyo.ts index 247c57ba..f9c494d2 100644 --- a/src/rules/saas/klaviyo.ts +++ b/src/rules/saas/klaviyo.ts @@ -4,4 +4,5 @@ register({ tech: 'klaviyo', name: 'Klaviyo', type: 'saas', + dependencies: [{ type: 'php', name: 'klaviyo/magento2-extension' }], }); diff --git a/src/rules/saas/launchdarkly.ts b/src/rules/saas/launchdarkly.ts index 6736558d..7b09b8ca 100644 --- a/src/rules/saas/launchdarkly.ts +++ b/src/rules/saas/launchdarkly.ts @@ -27,5 +27,7 @@ register({ type: 'terraform', name: 'registry.terraform.io/launchdarkly/launchdarkly', }, + { type: 'php', name: 'launchdarkly/server-sdk' }, + { type: 'php', name: 'launchdarkly/launchdarkly-php' }, ], }); diff --git a/src/rules/saas/mailchimp.ts b/src/rules/saas/mailchimp.ts index 0b174b7f..a263a1be 100644 --- a/src/rules/saas/mailchimp.ts +++ b/src/rules/saas/mailchimp.ts @@ -9,5 +9,8 @@ register({ { type: 'npm', name: '@mailchimp/mailchimp_transactional' }, { type: 'ruby', name: 'MailchimpMarketing' }, { type: 'ruby', name: 'MailchimpTransactional' }, + { type: 'php', name: 'drewm/mailchimp-api' }, + { type: 'php', name: 'mailchimp/transactional' }, + { type: 'php', name: 'mailchimp/makerting' }, ], }); diff --git a/src/rules/saas/mailjet.ts b/src/rules/saas/mailjet.ts index 833dd87a..c6523e66 100644 --- a/src/rules/saas/mailjet.ts +++ b/src/rules/saas/mailjet.ts @@ -8,5 +8,7 @@ register({ { type: 'npm', name: 'node-mailjet' }, { type: 'rust', name: 'mailjet-rs' }, { type: 'ruby', name: 'mailjet' }, + { type: 'php', name: 'mailjet/mailjet-apiv3-php' }, + { type: 'php', name: 'mailjet/laravel-mailjet' }, ], }); diff --git a/src/rules/saas/newrelic.ts b/src/rules/saas/newrelic.ts index cabba832..ea37ca44 100644 --- a/src/rules/saas/newrelic.ts +++ b/src/rules/saas/newrelic.ts @@ -8,5 +8,7 @@ register({ { type: 'npm', name: 'newrelic' }, { type: 'terraform', name: 'registry.terraform.io/newrelic/newrelic' }, { type: 'ruby', name: 'newrelic_rpm' }, + { type: 'php', name: 'ekino/newrelic-bundle' }, + { type: 'php', name: 'intouch/newrelic' }, ], }); diff --git a/src/rules/saas/okta.ts b/src/rules/saas/okta.ts index 41e9acc7..b717c13f 100644 --- a/src/rules/saas/okta.ts +++ b/src/rules/saas/okta.ts @@ -9,5 +9,6 @@ register({ { type: 'terraform', name: 'registry.terraform.io/okta/okta' }, { type: 'rust', name: 'okta' }, { type: 'ruby', name: 'oktakit' }, + { type: 'php', name: 'socialiteproviders/okta' }, ], }); diff --git a/src/rules/saas/openai.ts b/src/rules/saas/openai.ts index 18e4921b..b789b754 100644 --- a/src/rules/saas/openai.ts +++ b/src/rules/saas/openai.ts @@ -4,5 +4,9 @@ register({ tech: 'openai', name: 'Openai', type: 'saas', - dependencies: [{ type: 'npm', name: 'openai' }], + dependencies: [ + { type: 'npm', name: 'openai' }, + { type: 'php', name: 'openai-php/client' }, + { type: 'php', name: 'openai-php/laravel' }, + ], }); diff --git a/src/rules/saas/pagerduty.ts b/src/rules/saas/pagerduty.ts index bc78c51b..acc1526b 100644 --- a/src/rules/saas/pagerduty.ts +++ b/src/rules/saas/pagerduty.ts @@ -9,5 +9,6 @@ register({ { type: 'terraform', name: 'registry.terraform.io/PagerDuty/pagerduty' }, { type: 'rust', name: 'pagerduty-rs' }, { type: 'ruby', name: 'pagerduty' }, + { type: 'php', name: 'adilbaig/pagerduty' }, ], }); diff --git a/src/rules/saas/resend.ts b/src/rules/saas/resend.ts index 3153b3c3..2a4241e9 100644 --- a/src/rules/saas/resend.ts +++ b/src/rules/saas/resend.ts @@ -4,5 +4,8 @@ register({ tech: 'resend', name: 'Resend', type: 'saas', - dependencies: [{ type: 'npm', name: 'resend' }], + dependencies: [ + { type: 'npm', name: 'resend' }, + { type: 'php', name: 'resend/resend-php' }, + ], }); diff --git a/src/rules/saas/sendgrid.ts b/src/rules/saas/sendgrid.ts index 3adf89e1..c6cba005 100644 --- a/src/rules/saas/sendgrid.ts +++ b/src/rules/saas/sendgrid.ts @@ -6,5 +6,6 @@ register({ type: 'saas', dependencies: [ { type: 'npm', name: /^@sendgrid\//, example: '@sendgrid/mail' }, + { type: 'php', name: 'sendgrid/sendgrid' }, ], }); diff --git a/src/rules/saas/sentry.ts b/src/rules/saas/sentry.ts index 0300ff6f..84d8474f 100644 --- a/src/rules/saas/sentry.ts +++ b/src/rules/saas/sentry.ts @@ -8,5 +8,9 @@ register({ { type: 'npm', name: /^@sentry\//, example: '@sentry/browser' }, { type: 'rust', name: 'sentry' }, { type: 'ruby', name: /^sentry-/, example: 'sentry-rails' }, + { type: 'php', name: 'sentry/sentry' }, + { type: 'php', name: 'sentry/sentry-symfony' }, + { type: 'php', name: 'sentry/sentry-laravel' }, + { type: 'php', name: 'sentry/sdk' }, ], }); diff --git a/src/rules/saas/shopify.ts b/src/rules/saas/shopify.ts index 5c0a3849..67ee394a 100644 --- a/src/rules/saas/shopify.ts +++ b/src/rules/saas/shopify.ts @@ -6,5 +6,7 @@ register({ type: 'saas', dependencies: [ { type: 'npm', name: /^@shopify\//, example: '@shopify/shopify-api' }, + { type: 'php', name: 'shopify/shopify-api' }, + { type: 'php', name: 'phpclassic/php-shopify' }, ], }); diff --git a/src/rules/saas/slack.ts b/src/rules/saas/slack.ts index 6db9e341..ec304123 100644 --- a/src/rules/saas/slack.ts +++ b/src/rules/saas/slack.ts @@ -9,5 +9,6 @@ register({ { type: 'terraform', name: 'registry.terraform.io/pablovarela/slack' }, { type: 'rust', name: 'slack-morphism' }, { type: 'ruby', name: 'slack-ruby-client' }, + { type: 'php', name: 'laravel/slack-notification-channel' }, ], }); diff --git a/src/rules/saas/squareup.ts b/src/rules/saas/squareup.ts index ebbb4fa3..707c4903 100644 --- a/src/rules/saas/squareup.ts +++ b/src/rules/saas/squareup.ts @@ -4,4 +4,5 @@ register({ tech: 'squareup', name: 'Square', type: 'saas', + dependencies: [{ type: 'php', name: 'square/square' }], }); diff --git a/src/rules/saas/stripe.ts b/src/rules/saas/stripe.ts index f070530b..d393bdb6 100644 --- a/src/rules/saas/stripe.ts +++ b/src/rules/saas/stripe.ts @@ -4,5 +4,11 @@ register({ tech: 'stripe', name: 'Stripe', type: 'saas', - dependencies: [{ type: 'npm', name: 'stripe' }], + dependencies: [ + { type: 'npm', name: 'stripe' }, + { type: 'php', name: 'stripe/stripe-php' }, + { type: 'php', name: 'laravel/cashier' }, + { type: 'php', name: 'omnipay/stripe' }, + { type: 'php', name: 'cartalyst/stripe' }, + ], }); diff --git a/src/rules/saas/twilio.ts b/src/rules/saas/twilio.ts index 7cbe49a0..17f4516c 100644 --- a/src/rules/saas/twilio.ts +++ b/src/rules/saas/twilio.ts @@ -7,5 +7,6 @@ register({ dependencies: [ { type: 'npm', name: 'twilio' }, { type: 'npm', name: /^@twilio\//, example: '@twilio/cli-core' }, + { type: 'php', name: 'twilio/sdk' }, ], }); diff --git a/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap b/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap index cc346dd2..a2f9e4b8 100644 --- a/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/nodejs/__snapshots__/component.test.ts.snap @@ -24,6 +24,7 @@ exports[`npm > should match everything 1`] = ` "browserstack", "clickhouse", "cloudflare", + "contenful", "couchbase", "crowdin", "cypressci", @@ -679,6 +680,16 @@ exports[`npm > should match everything 2`] = ` "browserstack", "0.0.0", ], + [ + "npm", + "contentful", + "0.0.0", + ], + [ + "npm", + "contentful-management", + "0.0.0", + ], [ "npm", "couchbase", @@ -769,6 +780,11 @@ exports[`npm > should match everything 2`] = ` "fastly", "0.0.0", ], + [ + "npm", + "fastly/fastly", + "0.0.0", + ], [ "npm", "firebase", diff --git a/src/rules/spec/php/__snapshots__/component.test.ts.snap b/src/rules/spec/php/__snapshots__/component.test.ts.snap index 40db87c5..2ba1933f 100644 --- a/src/rules/spec/php/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/php/__snapshots__/component.test.ts.snap @@ -2,9 +2,34 @@ exports[`php > should match everything 1`] = ` [ + "airtable", "algolia", + "alibabacloud", "amplitude", + "apache_couchdb", + "apache_kafka", + "auth0", "aws", + "aws.dynamodb", + "aws.elasticache", + "aws.lambda", + "aws.rds", + "aws.s3", + "aws.sns", + "aws.sqs", + "bigcommerce", + "bitbucket", + "clickhouse", + "cloudflare", + "cockroachdb", + "contenful", + "couchbase", + "crowdin", + "datadog", + "datastax", + "docusign", + "dropbox", + "elasticsearch", "firebase", "firebase.firestore", "gcp", @@ -25,25 +50,246 @@ exports[`php > should match everything 1`] = ` "gcp.sql", "gcp.translate", "gcp.vision", + "github", + "gitlab", "googleanalytics", + "hashicorp_vault", + "heroku", + "hubspot", + "influxdb", + "klaviyo", + "kubernetes", + "laravel", + "launchdarkly", + "magento", + "mailchimp", + "mailjet", "mixpanel", + "mongodb", + "newrelic", + "okta", + "openai", + "oraclecloud", + "ovh", + "pagerduty", "php", + "phpunit", + "postgresql", + "rabbitmq", "redis", + "resend", + "sendgrid", + "sentry", + "shopify", + "slack", + "squareup", + "stripe", + "symfony", + "tencentcloud", + "twigphp", + "twilio", + "wordpress", + "zookeeper", ] `; exports[`php > should match everything 2`] = ` [ + [ + "php", + "adilbaig/pagerduty", + "0.0.0", + ], [ "php", "algolia/algoliasearch-client-php", "0.0.0", ], + [ + "php", + "algolia/scout-extended", + "0.0.0", + ], + [ + "php", + "alibabacloud/client", + "0.0.0", + ], + [ + "php", + "alibabacloud/sdk", + "0.0.0", + ], + [ + "php", + "async-aws/dynamo-db", + "0.0.0", + ], + [ + "php", + "async-aws/lambda", + "0.0.0", + ], + [ + "php", + "async-aws/rds-data-service", + "0.0.0", + ], + [ + "php", + "async-aws/s3", + "0.0.0", + ], + [ + "php", + "async-aws/simple-s3", + "0.0.0", + ], + [ + "php", + "async-aws/sns", + "0.0.0", + ], + [ + "php", + "async-aws/sqs", + "0.0.0", + ], + [ + "php", + "atyagi/elasticache-laravel", + "0.0.0", + ], + [ + "php", + "auth0/auth0-php", + "0.0.0", + ], + [ + "php", + "auth0/login", + "0.0.0", + ], + [ + "php", + "aws/aws-php-sns-message-validator", + "0.0.0", + ], [ "php", "aws/aws-sdk-php", "0.0.0", ], + [ + "php", + "baopham/dynamodb", + "0.0.0", + ], + [ + "php", + "bigcommerce/api", + "0.0.0", + ], + [ + "php", + "bitbucket/client", + "0.0.0", + ], + [ + "php", + "cartalyst/stripe", + "0.0.0", + ], + [ + "php", + "cloudflare/sdk", + "0.0.0", + ], + [ + "php", + "colinmollenhour/cache-backend-redis", + "0.0.0", + ], + [ + "php", + "contentful/contentful", + "0.0.0", + ], + [ + "php", + "contentful/contentful-management", + "0.0.0", + ], + [ + "php", + "couchbase/couchbase", + "0.0.0", + ], + [ + "php", + "crowdin/crowdin-api-client", + "0.0.0", + ], + [ + "php", + "csharpru/vault-php", + "0.0.0", + ], + [ + "php", + "datadog/dd-trace", + "0.0.0", + ], + [ + "php", + "datadog/php-datadogstatsd", + "0.0.0", + ], + [ + "php", + "datastax/php-driver", + "0.0.0", + ], + [ + "php", + "doctrine/couchdb", + "0.0.0", + ], + [ + "php", + "doctrine/lexer", + "0.0.0", + ], + [ + "php", + "docusign/esign-client", + "0.0.0", + ], + [ + "php", + "drewm/mailchimp-api", + "0.0.0", + ], + [ + "php", + "ekino/newrelic-bundle", + "0.0.0", + ], + [ + "php", + "elasticsearch/elasticsearch", + "0.0.0", + ], + [ + "php", + "encentcloud/tencentcloud-sdk-php", + "0.0.0", + ], + [ + "php", + "fastly/magento2", + "0.0.0", + ], [ "php", "google/analytics-admin", @@ -154,26 +400,296 @@ exports[`php > should match everything 2`] = ` "google/cloud-vision", "0.0.0", ], + [ + "php", + "heroku/heroku-buildpack-php", + "0.0.0", + ], + [ + "php", + "hubspot/api-client", + "0.0.0", + ], + [ + "php", + "hubspot/hubspot-php", + "0.0.0", + ], + [ + "php", + "influxdata/influxdb-client-php", + "0.0.0", + ], + [ + "php", + "intouch/newrelic", + "0.0.0", + ], + [ + "php", + "johnpbloch/wordpress", + "0.0.0", + ], + [ + "php", + "klaviyo/magento2-extension", + "0.0.0", + ], + [ + "php", + "knplabs/github-api", + "0.0.0", + ], + [ + "php", + "kubernetes/php-client", + "0.0.0", + ], + [ + "php", + "laravel/cashier", + "0.0.0", + ], + [ + "php", + "laravel/framework", + "0.0.0", + ], + [ + "php", + "laravel/slack-notification-channel", + "0.0.0", + ], + [ + "php", + "launchdarkly/launchdarkly-php", + "0.0.0", + ], + [ + "php", + "launchdarkly/server-sdk", + "0.0.0", + ], + [ + "php", + "longlang/phpkafka", + "0.0.0", + ], + [ + "php", + "m4tthumphrey/php-gitlab-api", + "0.0.0", + ], + [ + "php", + "magento/composer", + "0.0.0", + ], + [ + "php", + "mailchimp/makerting", + "0.0.0", + ], + [ + "php", + "mailchimp/transactional", + "0.0.0", + ], + [ + "php", + "mailjet/laravel-mailjet", + "0.0.0", + ], + [ + "php", + "mailjet/mailjet-apiv3-php", + "0.0.0", + ], + [ + "php", + "martin-georgiev/postgresql-for-doctrine", + "0.0.0", + ], [ "php", "mixpanel/mixpanel-php", "0.0.0", ], + [ + "php", + "mongodb/mongodb", + "0.0.0", + ], + [ + "php", + "nbj/cockroachdb-laravel", + "0.0.0", + ], + [ + "php", + "nmred/kafka-php", + "0.0.0", + ], + [ + "php", + "omnipay/stripe", + "0.0.0", + ], + [ + "php", + "openai-php/client", + "0.0.0", + ], + [ + "php", + "openai-php/laravel", + "0.0.0", + ], + [ + "php", + "oracle/oci-php-sdk", + "0.0.0", + ], + [ + "php", + "ovh/ovh", + "0.0.0", + ], + [ + "php", + "php-amqplib/php-amqplib", + "0.0.0", + ], + [ + "php", + "phpclassic/php-shopify", + "0.0.0", + ], + [ + "php", + "phpunit/phpunit", + "0.0.0", + ], [ "php", "predis/predis", "0.0.0", ], + [ + "php", + "resend/resend-php", + "0.0.0", + ], + [ + "php", + "roots/wordpress", + "0.0.0", + ], + [ + "php", + "sendgrid/sendgrid", + "0.0.0", + ], + [ + "php", + "sentry/sdk", + "0.0.0", + ], + [ + "php", + "sentry/sentry", + "0.0.0", + ], + [ + "php", + "sentry/sentry-laravel", + "0.0.0", + ], + [ + "php", + "sentry/sentry-symfony", + "0.0.0", + ], + [ + "php", + "shopify/shopify-api", + "0.0.0", + ], + [ + "php", + "sleiman/airtable-php", + "0.0.0", + ], + [ + "php", + "smi2/phpclickhouse", + "0.0.0", + ], + [ + "php", + "smile/elasticsuite", + "0.0.0", + ], + [ + "php", + "snc/redis-bundle", + "0.0.0", + ], + [ + "php", + "socialiteproviders/okta", + "0.0.0", + ], + [ + "php", + "sparkinfluence/zookeeper", + "0.0.0", + ], + [ + "php", + "spatie/dropbox-api", + "0.0.0", + ], [ "php", "spatie/laravel-analytics", "0.0.0", ], + [ + "php", + "square/square", + "0.0.0", + ], + [ + "php", + "stripe/stripe-php", + "0.0.0", + ], + [ + "php", + "symfony/yaml", + "0.0.0", + ], [ "php", "theiconic/php-ga-measurement-protocol", "0.0.0", ], + [ + "php", + "twig/twig", + "0.0.0", + ], + [ + "php", + "twilio/sdk", + "0.0.0", + ], + [ + "php", + "wp-cli/wp-cli", + "0.0.0", + ], [ "php", "zumba/amplitude-php", diff --git a/src/rules/storage/aws.s3.ts b/src/rules/storage/aws.s3.ts index aa8cb8b0..738d9daa 100644 --- a/src/rules/storage/aws.s3.ts +++ b/src/rules/storage/aws.s3.ts @@ -15,5 +15,7 @@ register({ name: /^aws_s3/, example: 'aws_s3_bucket', }, + { type: 'php', name: 'async-aws/s3' }, + { type: 'php', name: 'async-aws/simple-s3' }, ], }); diff --git a/src/rules/tool/gitlab.ts b/src/rules/tool/gitlab.ts index 994c0101..1f81a1e1 100644 --- a/src/rules/tool/gitlab.ts +++ b/src/rules/tool/gitlab.ts @@ -8,5 +8,6 @@ register({ { type: 'terraform', name: 'registry.terraform.io/gitlabhq/gitlab' }, { type: 'rust', name: 'gitlab' }, { type: 'ruby', name: 'gitlab' }, + { type: 'php', name: 'm4tthumphrey/php-gitlab-api' }, ], }); diff --git a/src/types/techs.ts b/src/types/techs.ts index 76574ca4..50ffaa53 100644 --- a/src/types/techs.ts +++ b/src/types/techs.ts @@ -157,6 +157,7 @@ export type AllowedKeys = | 'launchdarkly' | 'logrocket' | 'logsnag' + | 'magento' | 'mailchimp' | 'mailjet' | 'mariadb' @@ -269,6 +270,7 @@ export type AllowedKeys = | 'webflow' | 'webpack' | 'wiz' + | 'wordpress' | 'zapier' | 'zendesk' | 'zookeeper' From 020544faf236f6bf429ad336df4d73c56b7bfa10 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Thu, 7 Sep 2023 22:25:00 +0200 Subject: [PATCH 3/3] add more --- src/rules/__snapshots__/index.test.ts.snap | 3 +++ src/rules/db/elasticsearch.ts | 1 + src/rules/php/doctrinephp.ts | 1 - src/rules/php/index.ts | 3 +++ src/rules/php/phpstan.ts | 9 +++++++ src/rules/php/symfony.ts | 3 +-- src/rules/php/woocommerce.ts | 8 ++++++ src/rules/php/yii2.ts | 8 ++++++ .../php/__snapshots__/component.test.ts.snap | 25 ++++++++++++++++++- src/types/techs.ts | 4 +++ 10 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 src/rules/php/phpstan.ts create mode 100644 src/rules/php/woocommerce.ts create mode 100644 src/rules/php/yii2.ts diff --git a/src/rules/__snapshots__/index.test.ts.snap b/src/rules/__snapshots__/index.test.ts.snap index 802c0343..6fdd06f4 100644 --- a/src/rules/__snapshots__/index.test.ts.snap +++ b/src/rules/__snapshots__/index.test.ts.snap @@ -157,6 +157,7 @@ exports[`all > should match everything 1`] = ` "pagerduty", "percona", "php", + "phpstan", "phpunit", "pingdom", "placekit", @@ -238,7 +239,9 @@ exports[`all > should match everything 1`] = ` "webflow", "webpack", "wiz", + "woocommerce", "wordpress", + "yii2", "zapier", "zendesk", "zookeeper", diff --git a/src/rules/db/elasticsearch.ts b/src/rules/db/elasticsearch.ts index 3f5f6c5d..a69401a5 100644 --- a/src/rules/db/elasticsearch.ts +++ b/src/rules/db/elasticsearch.ts @@ -16,5 +16,6 @@ register({ { type: 'ruby', name: 'elasticsearch' }, { type: 'ruby', name: 'aws-sdk-elasticsearchservice' }, { type: 'php', name: 'elasticsearch/elasticsearch' }, + { type: 'php', name: 'ruflin/Elastica' }, ], }); diff --git a/src/rules/php/doctrinephp.ts b/src/rules/php/doctrinephp.ts index ef0befc2..2dd21bc8 100644 --- a/src/rules/php/doctrinephp.ts +++ b/src/rules/php/doctrinephp.ts @@ -4,7 +4,6 @@ register({ tech: 'doctrinephp', name: 'Doctrine', type: 'tool', - files: ['artisan'], dependencies: [ { type: 'php', name: 'doctrine/orm', example: 'doctrine/lexer' }, ], diff --git a/src/rules/php/index.ts b/src/rules/php/index.ts index 2cf902b1..45121fe0 100644 --- a/src/rules/php/index.ts +++ b/src/rules/php/index.ts @@ -1,7 +1,10 @@ import './doctrinephp.js'; import './laravel.js'; import './magento.js'; +import './phpstan.js'; import './phpunit.js'; import './symfony.js'; import './twig.js'; +import './woocommerce.js'; import './wordpress.js'; +import './yii2.js'; diff --git a/src/rules/php/phpstan.ts b/src/rules/php/phpstan.ts new file mode 100644 index 00000000..8f479398 --- /dev/null +++ b/src/rules/php/phpstan.ts @@ -0,0 +1,9 @@ +import { register } from '../../register.js'; + +register({ + tech: 'phpstan', + name: 'PHPStan', + type: 'tool', + files: ['phpstan.neon'], + dependencies: [{ type: 'php', name: 'phpstan/phpstan' }], +}); diff --git a/src/rules/php/symfony.ts b/src/rules/php/symfony.ts index 9efd0365..ff755b41 100644 --- a/src/rules/php/symfony.ts +++ b/src/rules/php/symfony.ts @@ -4,6 +4,5 @@ register({ tech: 'symfony', name: 'Symfony', type: 'tool', - files: ['artisan'], - dependencies: [{ type: 'php', name: /^symfony\//, example: 'symfony/yaml' }], + dependencies: [{ type: 'php', name: 'symfony/symfony' }], }); diff --git a/src/rules/php/woocommerce.ts b/src/rules/php/woocommerce.ts new file mode 100644 index 00000000..ae962507 --- /dev/null +++ b/src/rules/php/woocommerce.ts @@ -0,0 +1,8 @@ +import { register } from '../../register.js'; + +register({ + tech: 'woocommerce', + name: 'WooCommerce', + type: 'tool', + dependencies: [{ type: 'php', name: 'automattic/woocommerce' }], +}); diff --git a/src/rules/php/yii2.ts b/src/rules/php/yii2.ts new file mode 100644 index 00000000..21055e53 --- /dev/null +++ b/src/rules/php/yii2.ts @@ -0,0 +1,8 @@ +import { register } from '../../register.js'; + +register({ + tech: 'yii2', + name: 'Yii2', + type: 'tool', + dependencies: [{ type: 'php', name: 'yiisoft/yii2' }], +}); diff --git a/src/rules/spec/php/__snapshots__/component.test.ts.snap b/src/rules/spec/php/__snapshots__/component.test.ts.snap index 2ba1933f..5da32640 100644 --- a/src/rules/spec/php/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/php/__snapshots__/component.test.ts.snap @@ -73,6 +73,7 @@ exports[`php > should match everything 1`] = ` "ovh", "pagerduty", "php", + "phpstan", "phpunit", "postgresql", "rabbitmq", @@ -88,7 +89,9 @@ exports[`php > should match everything 1`] = ` "tencentcloud", "twigphp", "twilio", + "woocommerce", "wordpress", + "yii2", "zookeeper", ] `; @@ -170,6 +173,11 @@ exports[`php > should match everything 2`] = ` "auth0/login", "0.0.0", ], + [ + "php", + "automattic/woocommerce", + "0.0.0", + ], [ "php", "aws/aws-php-sns-message-validator", @@ -565,6 +573,11 @@ exports[`php > should match everything 2`] = ` "phpclassic/php-shopify", "0.0.0", ], + [ + "php", + "phpstan/phpstan", + "0.0.0", + ], [ "php", "phpunit/phpunit", @@ -585,6 +598,11 @@ exports[`php > should match everything 2`] = ` "roots/wordpress", "0.0.0", ], + [ + "php", + "ruflin/Elastica", + "0.0.0", + ], [ "php", "sendgrid/sendgrid", @@ -667,7 +685,7 @@ exports[`php > should match everything 2`] = ` ], [ "php", - "symfony/yaml", + "symfony/symfony", "0.0.0", ], [ @@ -690,6 +708,11 @@ exports[`php > should match everything 2`] = ` "wp-cli/wp-cli", "0.0.0", ], + [ + "php", + "yiisoft/yii2", + "0.0.0", + ], [ "php", "zumba/amplitude-php", diff --git a/src/types/techs.ts b/src/types/techs.ts index 50ffaa53..c29ed92f 100644 --- a/src/types/techs.ts +++ b/src/types/techs.ts @@ -183,6 +183,7 @@ export type AllowedKeys = | 'pagerduty' | 'percona' | 'php' + | 'phpstan' | 'phpunit' | 'pingdom' | 'placekit' @@ -270,7 +271,10 @@ export type AllowedKeys = | 'webflow' | 'webpack' | 'wiz' + | 'woocommerce' | 'wordpress' + | 'yii2' + | 'yii2' | 'zapier' | 'zendesk' | 'zookeeper'