{"id":19039595,"url":"https://github.com/windwalker-io/compare","last_synced_at":"2026-03-12T20:13:32.695Z","repository":{"id":14263416,"uuid":"16971179","full_name":"windwalker-io/compare","owner":"windwalker-io","description":"[DEPRECATED] String comparation library.","archived":false,"fork":false,"pushed_at":"2023-07-18T08:29:42.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-21T15:09:02.496Z","etag":null,"topics":["compare","conditions"],"latest_commit_sha":null,"homepage":"https://github.com/ventoviro/windwalker","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/windwalker-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2014-02-19T02:18:01.000Z","updated_at":"2024-12-16T13:47:28.000Z","dependencies_parsed_at":"2025-01-02T06:44:49.759Z","dependency_job_id":"38095cc5-41eb-46d7-84d0-7324454689f8","html_url":"https://github.com/windwalker-io/compare","commit_stats":null,"previous_names":["ventoviro/windwalker-compare"],"tags_count":84,"template":false,"template_full_name":null,"purl":"pkg:github/windwalker-io/compare","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windwalker-io%2Fcompare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windwalker-io%2Fcompare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windwalker-io%2Fcompare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windwalker-io%2Fcompare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/windwalker-io","download_url":"https://codeload.github.com/windwalker-io/compare/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windwalker-io%2Fcompare/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30441857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["compare","conditions"],"created_at":"2024-11-08T22:17:46.326Z","updated_at":"2026-03-12T20:13:32.674Z","avatar_url":"https://github.com/windwalker-io.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Windwalker Compare\n\n## What is Compare\n\nSometimes we will need a dynamic compare interface, but it hard to convert `=` or `\u003c=` string to be php operator.\n\nCompare object can help us create an object with compare logic between two values, and convert it to string, then we can use this string to build SQL or other use.\n\n## Installation via Composer\n\nAdd this to the require block in your `composer.json`.\n\n``` json\n{\n    \"require\": {\n        \"windwalker/compare\": \"~3.0\"\n    }\n}\n```\n\n## Basic Usage\n\n``` php\necho new GteCompare('published', '1');\n```\n\nWe will get `published \u003e= 1` string. This is easy to integate into query string.\n\n``` php\n$conditions = array(\n    GteCompare('published', '1'),\n    EqCompare('entry_id', 25),\n    LteCompare('date', $query-\u003equote($date))\n);\n\n$sql = 'WHERE ' . implode(' AND ' , $conditions);\n```\n\nWe will get this string: `WHERE published \u003e= 1 AND entry_id = 25 AND data \u003c= '2014-03-02'`.\n\n## Do Compare\n\n``` php\n$compare = new GteCompare(3, '1');\n\n$result = $compare-\u003ecompare();\n\nvar_dump($result); // bool(true)\n```\n\n## Available Compare Object\n\n| Name       | Description         | Operator |\n| ---------- | ------------------- | -------- |\n| EqCompare  | Equal                    | `=`  |\n| NeqCompare | Not Equal                | `!=` |\n| GtCompare  | Greater than             | `\u003e`  |\n| GteCompare | Greater than or Equal    | `\u003e=` |\n| LtCompare  | Less than                | `\u003c`  |\n| LteCompare | Less than or Equal       | `\u003c=` |\n| InCompare  | In an array or list      | `IN` |\n| NinCompare | Not In an array or list  | `IN` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindwalker-io%2Fcompare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindwalker-io%2Fcompare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindwalker-io%2Fcompare/lists"}