{"id":15657498,"url":"https://github.com/createnl/zxcvbn-bundle","last_synced_at":"2025-05-05T15:48:51.957Z","repository":{"id":40370293,"uuid":"260446644","full_name":"createnl/zxcvbn-bundle","owner":"createnl","description":"Symfony Zxcvbn","archived":false,"fork":false,"pushed_at":"2023-12-21T15:39:29.000Z","size":24,"stargazers_count":5,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-25T00:27:16.596Z","etag":null,"topics":["localized","php","symfony-bundle","zxcvbn"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/createnl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-01T11:49:12.000Z","updated_at":"2025-02-25T08:14:42.000Z","dependencies_parsed_at":"2024-10-03T13:07:33.143Z","dependency_job_id":"d5cda410-1a8e-4917-9416-6e0e1af14b25","html_url":"https://github.com/createnl/zxcvbn-bundle","commit_stats":{"total_commits":15,"total_committers":3,"mean_commits":5.0,"dds":"0.19999999999999996","last_synced_commit":"233e9ac7ee7a918b96d62101e5349ad7c3ab8ea2"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/createnl%2Fzxcvbn-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/createnl%2Fzxcvbn-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/createnl%2Fzxcvbn-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/createnl%2Fzxcvbn-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/createnl","download_url":"https://codeload.github.com/createnl/zxcvbn-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252526139,"owners_count":21762439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["localized","php","symfony-bundle","zxcvbn"],"created_at":"2024-10-03T13:07:28.152Z","updated_at":"2025-05-05T15:48:51.924Z","avatar_url":"https://github.com/createnl.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/createnl/zxcvbn-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/createnl/zxcvbn-bundle/?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/createnl/zxcvbn-bundle/badge.svg?branch=master)](https://coveralls.io/github/createnl/zxcvbn-bundle?branch=master)\n[![CI](https://github.com/createnl/zxcvbn-bundle/workflows/CI/badge.svg)](https://github.com/createnl/zxcvbn-bundle/actions?query=workflow%3ACI)\n[![Packagist](https://img.shields.io/packagist/dt/createnl/zxcvbn-bundle)](https://packagist.org/packages/createnl/zxcvbn-bundle)\n\n# Zxcvbn Symfony Bundle\nA bundle to integrate [zxcvbn-php](https://github.com/bjeavons/zxcvbn-php) with your symfony app. Supports localization and custom matchers. \n\n## Installation\n```bash\ncomposer require createnl/zxcvbn-bundle\n```\n\n## Basic Usage\n```php\nuse Createnl\\ZxcvbnBundle\\ZxcvbnFactoryInterface;\n\nclass PasswordController\n{\n    public function updatePassword(string $password, ZxcvbnFactoryInterface $zxcvbnFactory)\n    {\n        $userData = [\n          'Marco',\n          'marco@example.com'\n        ];\n\n        $zxcvbn = $zxcvbnFactory-\u003ecreateZxcvbn();\n\n        $weak = $zxcvbn-\u003epasswordStrength($password, $userData);\n        echo $weak['score']; // will print 0\n        \n        $strong = $zxcvbn-\u003epasswordStrength('correct horse battery staple');\n        echo $strong['score']; // will print 4\n\n        echo $weak['feedback']['warning']; // will print user-facing feedback on the password, set only when score \u003c= 2\n        echo $weak['feedback']['suggestions']; // may contain user-facing suggestions to improve the score\n    }\n}\n```\n\n## Localization\nThis package supports the localization of warning and suggestion messages. Checks on common passwords, words and (family) names are only in English (US). But you can [tag your own matcher](#extending-matchers) to extend to your needs. \n\nSupported languages:\n- Dutch 🇳🇱\n- English 🇺🇸\n- French 🇫🇷\n\n[More about localization in Symfony.](https://symfony.com/doc/current/translation.html#configuration)\n\n## Adding translations\nIf you are missing translations in your language you may consider creating (and contribute) them.\n\nOverride in your project:\n1. Open [messages.en.yaml](src/Resources/translations/messages.en.yaml)\n2. Copy the contents to your project's translation file\n3. Change to your needs\n\nContributing a language:\n1. Fork this repository\n2. Copy [messages.en.yaml](src/Resources/translations/messages.en.yaml)\n3. Change the filename to `messages.LOCALE.yaml` (for example `messages.es.yaml`)\n4. Open it up and translate the right-hand values to your language\n5. Create a Pull Request\n6. Thank you!\n\n## Extending matchers\nIf you created your own matcher you can tag them with `zxcvbn.matcher` in your service container.\n```yaml\nservices:\n  App\\ZxcvbnMatchers\\:\n    resource: '../src/ZxcvbnMatchers'\n    tags: ['zxcvbn.matcher']\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreatenl%2Fzxcvbn-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreatenl%2Fzxcvbn-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreatenl%2Fzxcvbn-bundle/lists"}