{"id":24016320,"url":"https://github.com/decodelabs/lucid-support","last_synced_at":"2025-04-15T14:07:31.145Z","repository":{"id":58849701,"uuid":"534117762","full_name":"decodelabs/lucid-support","owner":"decodelabs","description":"Support Lucid sanitisation in your libraries without the dependencies","archived":false,"fork":false,"pushed_at":"2025-04-14T08:48:42.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-04-15T14:07:09.012Z","etag":null,"topics":["php","sanitization","validation"],"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/decodelabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-09-08T08:23:05.000Z","updated_at":"2025-04-14T08:48:45.000Z","dependencies_parsed_at":"2023-01-31T19:25:14.951Z","dependency_job_id":"8dd0f612-5535-4780-bf91-5c84752daf68","html_url":"https://github.com/decodelabs/lucid-support","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"22074ebc72fd70105c745643ab0845e9f4c78677"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Flucid-support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Flucid-support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Flucid-support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decodelabs%2Flucid-support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decodelabs","download_url":"https://codeload.github.com/decodelabs/lucid-support/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249085438,"owners_count":21210267,"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":["php","sanitization","validation"],"created_at":"2025-01-08T08:48:56.063Z","updated_at":"2025-04-15T14:07:31.139Z","avatar_url":"https://github.com/decodelabs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lucid Support\n\n[![PHP from Packagist](https://img.shields.io/packagist/php-v/decodelabs/lucid-support?style=flat)](https://packagist.org/packages/decodelabs/lucid-support)\n[![Latest Version](https://img.shields.io/packagist/v/decodelabs/lucid-support.svg?style=flat)](https://packagist.org/packages/decodelabs/lucid-support)\n[![Total Downloads](https://img.shields.io/packagist/dt/decodelabs/lucid-support.svg?style=flat)](https://packagist.org/packages/decodelabs/lucid-support)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/decodelabs/lucid-support/integrate.yml?branch=develop)](https://github.com/decodelabs/lucid-support/actions/workflows/integrate.yml)\n[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-44CC11.svg?longCache=true\u0026style=flat)](https://github.com/phpstan/phpstan)\n[![License](https://img.shields.io/packagist/l/decodelabs/lucid-support?style=flat)](https://packagist.org/packages/decodelabs/lucid-support)\n\n### Support Lucid sanitisation in your libraries without the dependencies\n\nLucid-support is a middleware package that allows third party libraries to implement the necessary interfaces and provide custom sanitiser and validator functionality to Lucid without dragging in the full dependency tree of the main library.\n\n---\n\n\n## Installation\n\nInstall the library via composer:\n\n```bash\ncomposer require decodelabs/lucid-support\n```\n\n## Usage\n[Lucid](https://github.com/decodelabs/lucid) provides interfaces and traits to implement providing input sanitisation from your own value container objects.\n\nThe main library however has a substantial dependency list which may not be desirable when deploying the Lucid Provider interfaces in your own libraries.\n\nInstead, those interfaces have been sectioned off in this package with a \u003ccode\u003eclass_exists()\u003c/code\u003e check to ensure that Lucid is available at runtime.\n\nIf you want to provide Lucid's sanitisation interface in a library, you only need to require _this_ package, and implement either \u003ccode\u003e[DirectContextProvider](./src/Sanitizer/DirectContextProvider.php)\u003c/code\u003e (for passing the value directly to the methods), \u003ccode\u003e[MultiContextProvider](./src/Sanitizer/MultiContextProvider.php)\u003c/code\u003e (for dictionaries and maps) or \u003ccode\u003e[SingleContextProvider](./src/Sanitizer/SingleContextProvider.php)\u003c/code\u003e (for single-value objects).\n\nFor example:\n\n```php\nnamespace My\\Library;\n\nuse DecodeLabs\\Lucid\\Provider\\SingleContext;\nuse DecodeLabs\\Lucid\\Provider\\SingleContextTrait;\n\nclass MyClass implements SingleContext {\n\n    use SingleContextTrait;\n\n    protected mixed $value;\n\n    public function __construct(mixed $value) {\n        $this-\u003evalue = $value;\n    }\n\n    /**\n     * This method provides the value to all other\n     * sanitisation methods in the interface\n     */\n    public function getValue(): mixed {\n        return $this-\u003evalue;\n    }\n}\n```\n\n## Licensing\nLucid Support is licensed under the MIT License. See [LICENSE](./LICENSE) for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecodelabs%2Flucid-support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecodelabs%2Flucid-support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecodelabs%2Flucid-support/lists"}