{"id":27398974,"url":"https://github.com/corncodecreators/line-dumper","last_synced_at":"2026-04-09T03:32:12.506Z","repository":{"id":251622093,"uuid":"837963718","full_name":"CornCodeCreators/line-dumper","owner":"CornCodeCreators","description":"Show and compare strings - line by line.","archived":false,"fork":false,"pushed_at":"2025-08-26T08:48:58.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-28T19:23:42.343Z","etag":null,"topics":["compare","line-by-line","string"],"latest_commit_sha":null,"homepage":"","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/CornCodeCreators.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,"zenodo":null}},"created_at":"2024-08-04T15:02:10.000Z","updated_at":"2025-08-26T08:48:57.000Z","dependencies_parsed_at":"2025-04-14T02:36:24.814Z","dependency_job_id":"e7a26ed5-8dcd-4817-badb-12a8fa90c25f","html_url":"https://github.com/CornCodeCreators/line-dumper","commit_stats":null,"previous_names":["corncodecreations/line-dumper","corncodecreators/line-dumper"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/CornCodeCreators/line-dumper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CornCodeCreators%2Fline-dumper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CornCodeCreators%2Fline-dumper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CornCodeCreators%2Fline-dumper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CornCodeCreators%2Fline-dumper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CornCodeCreators","download_url":"https://codeload.github.com/CornCodeCreators/line-dumper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CornCodeCreators%2Fline-dumper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279023125,"owners_count":26087422,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"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":["compare","line-by-line","string"],"created_at":"2025-04-14T02:36:15.629Z","updated_at":"2025-10-14T23:14:46.187Z","avatar_url":"https://github.com/CornCodeCreators.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LineDumper\n\u003e Show and compare strings - line by line.\n\n## Summary\nThis PHP class, `LineDumper`, provides a utility for comparing two strings line by line and highlights the differences between them. \n\n- If the strings are identical, it simply returns \"Strings are equal!\". \n\n- If they differ, it compares them line by line, indicating mismatches with color-coded output using ANSI escape codes.\n\n## Details\n- Namespace and Class Definition: The class is defined under the CornCodeCreators namespace.\n- compareLines Method:\n  - Input: It takes two strings, $expectedString and $actualString, which represent the expected output and the actual output.\n  - Output: It returns a string containing either a confirmation that the strings are equal or a line-by-line comparison highlighting differences. \n  - String Splitting: The strings are split into arrays of lines using explode(\"\\n\", $string).\n  - Line Number Width: The line numbers are padded to a width of 3 characters. \n  - Comparison: Each line from the expected string is compared to the corresponding line in the actual string:\n    - If the lines match, it outputs them with a simple \"ok\" status.\n    - If they don't match, it outputs the expected line in yellow (to-be) and the actual line in red (as-is).\n\n## Example\n**Input**\n```php\n$expected = \"This is a line.\\nAnother line.\";\n$actual   = \"This is a line.\\nAnother different line.\";\n\n$comparedLines = LineDumper::compareLines($expected, $actual);\n\necho($comparedLines);\n```\n**Output**\n```shell\nLine   1|   ok| This is a line.\nLine   2|to-be| Another line.\nLine   2|as-is| Another different line.\n```\n\n## Installation\n\n```shell\n$ composer require corncodecreators/line-dumper\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorncodecreators%2Fline-dumper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorncodecreators%2Fline-dumper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorncodecreators%2Fline-dumper/lists"}