{"id":15490111,"url":"https://github.com/tmilos/scim-filter-parser","last_synced_at":"2025-04-15T21:37:36.953Z","repository":{"id":57070662,"uuid":"76946107","full_name":"tmilos/scim-filter-parser","owner":"tmilos","description":"SCIM AST filter parser PHP library","archived":false,"fork":false,"pushed_at":"2023-01-31T17:43:56.000Z","size":25,"stargazers_count":11,"open_issues_count":5,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-24T09:25:44.672Z","etag":null,"topics":["php","scim","scim-2","scim-filter"],"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/tmilos.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}},"created_at":"2016-12-20T10:14:27.000Z","updated_at":"2023-01-23T21:49:33.000Z","dependencies_parsed_at":"2023-02-16T21:45:42.037Z","dependency_job_id":null,"html_url":"https://github.com/tmilos/scim-filter-parser","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmilos%2Fscim-filter-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmilos%2Fscim-filter-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmilos%2Fscim-filter-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmilos%2Fscim-filter-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmilos","download_url":"https://codeload.github.com/tmilos/scim-filter-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246126662,"owners_count":20727594,"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","scim","scim-2","scim-filter"],"created_at":"2024-10-02T07:09:23.066Z","updated_at":"2025-03-30T17:31:55.513Z","avatar_url":"https://github.com/tmilos.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SCIM filter parser\n\nThe PHP parser for SCIM filter. SCIM stands for System for Cross-domain Identity Management and more details can be\nfound on http://www.simplecloud.info/ website.\n\n[![Author](http://img.shields.io/badge/author-@tmilos-blue.svg?style=flat-square)](https://twitter.com/tmilos77)\n[![Build Status](https://travis-ci.org/tmilos/scim-filter-parser.svg?branch=master)](https://travis-ci.org/tmilos/scim-filter-parser)\n[![Coverage Status](https://coveralls.io/repos/github/tmilos/scim-filter-parser/badge.svg?branch=master)](https://coveralls.io/github/tmilos/scim-filter-parser?branch=master)\n[![Quality Score](https://img.shields.io/scrutinizer/g/tmilos/scim-filter-parser.svg?style=flat-square)](https://scrutinizer-ci.com/g/tmilos/scim-filter-parser)\n[![License](https://img.shields.io/packagist/l/tmilos/scim-filter-parser.svg)](https://packagist.org/packages/tmilos/scim-filter-parser)\n[![Packagist Version](https://img.shields.io/packagist/v/tmilos/scim-filter-parser.svg?style=flat-square)](https://packagist.org/packages/tmilos/scim-filter-parser)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/cc1043a0-daa9-481b-9840-109bdb43543b/mini.png)](https://insight.sensiolabs.com/projects/cc1043a0-daa9-481b-9840-109bdb43543b)\n\n\n# Usage\n\n### Filter mode\n\n```php\n\u003c?php\n$parser = new Parser(Mode::FILTER());\n$node = $parser-\u003eparse('userType eq \"Employee\" and (emails co \"example.com\" or emails.value co \"example.org\")');\n/*\nwalk the node...\n\nConjunction = {\n    ComparisonExpression =\u003e userType eq Employee\n    Disjunction =\u003e {\n        ComparisonExpression =\u003e emails co example.com\n        ComparisonExpression =\u003e emails.value co example.org\n    }\n}\n*/\n```\n\n### Path mode\n\n```php\n\u003c?php\n$parser = new Parser(Mode::PATH());\n$node = $parser-\u003eparse('members[value eq \"2819c223-7f76-453a-919d-413861904646\"].displayName');\n/*\nwalk the node...\n\nPath = {\n    ValuePath = {\n        AttributePath = 'members'\n        ComparisonExpression = value eq 2819c223-7f76-453a-919d-413861904646\n    }\n    AttributePath = displayName,\n}\n*/\n```\n\nFor more details look at the [filter mode](tests/ParserFilterModeTest.php) and [path mode](tests/ParserPathModeTest.php) unit tests.\n\n\n# Filter and path mode\n\nSCIM v2 for ``PATCH`` operations defines parsable path with different grammar than for the retrieving resources filter expressions.\nThe parser by default is in the FILTER mode, but you can switch it to PATH mode either with optional constructor argument or\nwith a ``Parser::setMode(Mode $mode)`` setter method.\n\n**Note**: Path mode is valid only for SCIM v2 version.\n\n```php\n\u003c?php\n$parser = new Parser(Mode::PATH());\n$parser-\u003eparse('username'); // OK\n$parser-\u003eparse('username eq \"xxx\"'); // throws ParseException - Col 8: Expected end of input, but got ' '\n```\n\n\n# SCIM filter version\n\nSCIM filter between versions v1 and v2 remained almost the same, with the difference that v2 introduced new ValuePath syntax.\nParser is by default in v2 mode, and you can switch it to v1 with ``Parser::setVersion(Version::V1())`` setter or with optional\nconstructor argument. In v1 mode it will throw syntax errors when brackets are encountered.\n\n```php\n\u003c?php\n$parser = new Parser(Mode::FILTER, Version::V1());\n$parser-\u003eparse('emails[type eq \"work\"]'); // throws ParseException - Col 6: Expected SP, got '['\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmilos%2Fscim-filter-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmilos%2Fscim-filter-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmilos%2Fscim-filter-parser/lists"}