{"id":20732159,"url":"https://github.com/ailixter/gears-filter","last_synced_at":"2026-05-23T03:35:37.501Z","repository":{"id":56942701,"uuid":"153926283","full_name":"ailixter/gears-filter","owner":"ailixter","description":"The project, which gears Filter functions.","archived":false,"fork":false,"pushed_at":"2019-08-17T13:56:33.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T10:27:50.640Z","etag":null,"topics":["component","config","conversion","filter","input","parameters","php","request","sanitization","typecast","validation"],"latest_commit_sha":null,"homepage":null,"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/ailixter.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":"2018-10-20T16:38:46.000Z","updated_at":"2019-08-16T12:26:37.000Z","dependencies_parsed_at":"2022-08-21T02:10:26.264Z","dependency_job_id":null,"html_url":"https://github.com/ailixter/gears-filter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ailixter/gears-filter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ailixter%2Fgears-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ailixter%2Fgears-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ailixter%2Fgears-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ailixter%2Fgears-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ailixter","download_url":"https://codeload.github.com/ailixter/gears-filter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ailixter%2Fgears-filter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33381989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T01:21:08.577Z","status":"online","status_checked_at":"2026-05-23T02:00:05.530Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["component","config","conversion","filter","input","parameters","php","request","sanitization","typecast","validation"],"created_at":"2024-11-17T05:18:12.732Z","updated_at":"2026-05-23T03:35:32.490Z","avatar_url":"https://github.com/ailixter.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gears-filter\nThe project, which gears Filter functions.\n\nCasts\n- variable\n- input GET, POST, etc.\n- array\n\nCast $var into $type.\n``` php\n$filter = new Filter;\n$int1 = $filter-\u003ecast(FILTER_VALIDATE_INT, '123');\n$int2 = $filter-\u003ecast(['filter'=\u003eFILTER_VALIDATE_INT, 'flags'=\u003e...], '123');\n$int3 = $filter-\u003ecast('int', '123');\n```\n\nCast input $key into $type.\n``` php\n $filter = new Filter;\n $int1 = $filter-\u003ecastInput(FILTER_VALIDATE_INT, INPUT_POST, 'p');\n $int2 = $filter-\u003ecastInput(['filter'=\u003eFILTER_VALIDATE_INT, 'flags'=\u003e...], INPUT_POST, 'p');\n $int3 = $filter-\u003ecastInput('int', INPUT_POST, 'p');\n```\n\nUtility Filter-based class ArrayFilter\n``` php\n$array = new ArrayFilter(['a' =\u003e 123, 'b' =\u003e 'false'], new Filter);\n$bool = $array-\u003eget('bool', 'b');\n$float = $array-\u003egetFloat('a', 0.0);\n$custom = $array-\u003egetCustomType('a');\n$all = $array-\u003ecastAll(['a' =\u003e 'float', 'b' =\u003e 'bool', 'undefined' =\u003e 'str']);\n```\n\nUtility Filter-based class InputFilter\n``` php\n$post = new InputFilter(INPUT_POST, new Filter);\n$bool = $post-\u003eget('bool', 'b');\n$float = $post-\u003egetFloat('a', 0.0);\n$custom = $post-\u003egetCustomType('a');\n$all = $post-\u003ecastAll(['a' =\u003e 'float', 'b' =\u003e 'bool', 'undefined' =\u003e 'str']);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Failixter%2Fgears-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Failixter%2Fgears-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Failixter%2Fgears-filter/lists"}