{"id":15296241,"url":"https://github.com/chrishalbert/php7mar","last_synced_at":"2025-10-07T08:31:02.234Z","repository":{"id":56952367,"uuid":"162300338","full_name":"chrishalbert/php7mar","owner":"chrishalbert","description":"PHP 7 Migration Assistant Report (MAR)","archived":false,"fork":true,"pushed_at":"2019-01-16T18:26:21.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T02:51:56.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Alexia/php7mar","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrishalbert.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-12-18T14:28:09.000Z","updated_at":"2020-02-29T13:53:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chrishalbert/php7mar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chrishalbert/php7mar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrishalbert%2Fphp7mar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrishalbert%2Fphp7mar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrishalbert%2Fphp7mar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrishalbert%2Fphp7mar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrishalbert","download_url":"https://codeload.github.com/chrishalbert/php7mar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrishalbert%2Fphp7mar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278743022,"owners_count":26037953,"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-07T02:00:06.786Z","response_time":59,"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":[],"created_at":"2024-09-30T18:09:49.450Z","updated_at":"2025-10-07T08:31:01.825Z","avatar_url":"https://github.com/chrishalbert.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n#### What is PHP 7 Migration Assistant Report(MAR)?\nPHP 7 MAR, or just \"php7mar\", is a command line utility to generate reports on existing PHP 5 code to assist developers in porting their code quickly to PHP 7.  It will run against invididual files or entire project folders.  Reports contain line numbers, issues noted, and suggested fixes along with documentation links.\n\n#### Will php7mar automatically fix my code?\nNo, php7mar does implement a full lexer to determine code changes and can not determine the intent of the code.  It uses lexer tokenizing, string matching, and regular expressions to find syntax changes that may cause issues when porting code to PHP 7.  As well, it will detect code snippets in comments and report them as it can not distinguish it as commented code.\n\n#### What has changed in PHP 7? (Read This!)\nIf you are currently unfamiliar with what will change moving to PHP 7 then read the [UPGRADING file in the current master branch of php-src](https://github.com/php/php-src/blob/PHP-7.0.0/UPGRADING).  Understanding these changes is important to reading the reports generated by php7mar.\n\n#### Does it handle very poorly styled code?\nVery poorly styled code will not parse well, but assuming there is at least some structure to the code style it should still parse.  If the code is entirely too poorly formatted there are several web sites that can be used to clean up source code.\n\n* http://www.phpformatter.com/ (Does not support PHP 5.4 [] array syntax.)\n* http://phpbeautifier.com/\n* http://phpcodecleaner.com/\n\n# Usage\nFirst, start by downloading or cloning this repository.  It does not need to be placed inside the folder containing the source code.\n\nTo begin, type on the command line:\n\n\tphp mar.php\n\nThis will produce a list of available arguments and switches.\n\nTypical usage would appear as:\n\n\tphp mar.php -f=\"/path/to/file/example.php\"\n\nOr:\n\n\tphp mar.php -f=\"/path/to/folder/example/\"\n\nThis would run against the example file or folder and save the resulting report into a reports folder inside the php7mar folder.  When referencing the file or folder to run against it is recommend to use a fully qualified path.  Relative paths are supported, but will be relative to the location of the php7mar folder.\n\nGive a try, use the included `testcases.php` to generate a report:\n\n\tphp mar.php -f=\"testcases.php\"\n\n## Available Options:\n**-f**\n```\n\tPath to the file or folder to run against.\n\tThe location of the file or folder to use for generating the report.  A fully qualified path is recommended.  Relative paths will be based off the php7mar folder.\n\t\t*Example: -f=\"/path/to/folder\"*\n```\n\n**-r**\n```\n\tPath to the folder to save the report.\n\tThe location to save the final report.  By default this saves into the reports/ folder inside the php7mar folder.  A fully qualified path is recommended.  Relative paths will be based off the php7mar folder.\n\t\t*Example: -r=\"/path/to/folder\"*\n```\n\n**-t**\n```\n\tTypes of tests to run.\n\tBy default all tests will run.  This option allows tests to be selected using a comma delimited list.  Allowable values: critical, nuance, and syntax.\n\t\t*Example: -t=\"syntax,nuance\"*\n```\n\n**-x**\n```\n\tList of file extension(s) to process.\n\tBy default *.php files are processed.\n\t\t*Example: -x=\"php,inc\"*\n```\n\n**-e**\n```\n\tExclusion tags that you can add above a line that is being flagged. Most useful for nuances which will remain in subsequent reports.\n\t\t*Example: -e=\"@ignoreNextLine\"*\n\t\tCode:\n\t\t// @ignoreNextLine\n\t\tforeach ($array as \u0026$byRef) {\n\t\n```\n\n**--php**\n```\n\tFile path to the PHP binary to use for syntax checking.\n\tIf this option is not used syntax checking will use the default PHP installtion to test syntax.\n\t\t*Example: --php=\"/path/to/php/binary/php\"*\n```\n\n# Test Types\n## Critical\nCritical tests look for issues that will cause broken code, compilation errors, or otherwise create code that works in unintended manors.\n\n## Nuance\nNuance tests look for issues that might cause silent underisable code behavior.  These tests can report many false positives as they can not determine the intent of the code being checked.\n\n## Syntax\nA basic command line based syntax checker that checks all files for standard syntax issues.  This is useful for double checking work after making many mass find and replace operations.  Please note that syntax checking adds a significant increase to processing time especially for large code bases.  To run without syntax checking use the -t option and omit syntax; -t=\"critical,nuance\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrishalbert%2Fphp7mar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrishalbert%2Fphp7mar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrishalbert%2Fphp7mar/lists"}