{"id":20032840,"url":"https://github.com/adamculp/php-compatibility-check","last_synced_at":"2025-07-04T09:38:04.593Z","repository":{"id":149090110,"uuid":"87130454","full_name":"adamculp/php-compatibility-check","owner":"adamculp","description":"Docker image to check PHP code for compatibility to PHP versions.","archived":false,"fork":false,"pushed_at":"2019-02-11T17:00:40.000Z","size":6,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T05:35:12.035Z","etag":null,"topics":["compatibility","compatibility-testing","docker","docker-image","php","php7","php71","php71-docker"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/adamculp/php-compatibility-check/","language":"Dockerfile","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/adamculp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-03T23:30:21.000Z","updated_at":"2022-09-21T00:18:31.000Z","dependencies_parsed_at":"2023-06-30T04:00:59.943Z","dependency_job_id":null,"html_url":"https://github.com/adamculp/php-compatibility-check","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adamculp/php-compatibility-check","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamculp%2Fphp-compatibility-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamculp%2Fphp-compatibility-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamculp%2Fphp-compatibility-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamculp%2Fphp-compatibility-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamculp","download_url":"https://codeload.github.com/adamculp/php-compatibility-check/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamculp%2Fphp-compatibility-check/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263484397,"owners_count":23473753,"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":["compatibility","compatibility-testing","docker","docker-image","php","php7","php71","php71-docker"],"created_at":"2024-11-13T09:43:28.947Z","updated_at":"2025-07-04T09:38:04.566Z","avatar_url":"https://github.com/adamculp.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-compatibility-check\nDocker image to check PHP code for compatibility to PHP versions.\n\nThe objective is to provide a quick report of known PHP security alerts, based on the contents from a given \ncomposer.lock file, in an easy to use Docker image.\n\nMore specifically this image provides 3 different applications to test with:\n\n- phpcompatibility/php-compatibility\n    * Leverages PHP_Codesniffer to \"sniff\" code for incompatible code to various versions of PHP.\n    It then reports what version of PHP the code is broken with, and what version of PHP the code\n    was broken by.\n- sstalle/php7cc\n    * Runs against the codebase and indicates what is broken in PHP version 7\n- etsy/phan\n    * Runs against the codebase and indicates what is broken in PHP version 7+\n\n\nIMPORTANT: This tool makes no claims of being an exhaustive reference, but with the 3 included tools, should \nbe fairly comprehensive.\n\n## Usage\n\nWindows users: The use of \"$PWD\" for present working directory will not work as expected, instead use the full path. \nSuch as \"//c/Users/adamculp/project\".\n\n### PHPCompatibility\n\nMore info on how to run this tool can be found at: https://github.com/PHPCompatibility/PHPCompatibility\n\n```\n$ docker run -it --rm -v \"$PWD\":/app -w /app adamculp/php-code-quality:latest sh -c \\\n'php /usr/local/lib/php-code-quality/vendor/bin/phpcs -sv --config-set installed_paths  /usr/local/lib/php-code-quality/vendor/phpcompatibility/php-compatibility \u0026\u0026 \\\nphp /usr/local/lib/php-code-quality/vendor/bin/phpcs -sv --standard='PHPCompatibility' --extensions=php --ignore=vendor . \\\n--report-file=./php_code_quality/phpcompatibility_results.txt .'\n```\n\nIn the example above, Docker runs an interactive terminal to be removed when all is completed, and mounts \nthe current host directory ($PWD) inside the container, sets this as the current working directory, and then \nloads the image adamculp/php-compatibility-check. Following this we call the chosen application to check on \nthe code, and finally, output the results to a text file in the current working directory.\n\nThis is the most common use case, enabling the user to run the tool on code located anywhere \non the host system by altering the path used in the command.\n\n### Other Tool Examples\n\n#### php7cc\n\nMore info on how to run this tool can be found at: https://github.com/sstalle/php7cc\n\n```\n$ docker run -it --rm -v \"$PWD\":/app -w /app adamculp/php-compatibility-check:latest \\\nphp vendor/bin/php7cc --extensions=php \\\n--except=vendor \u003e ./php7cc_results.txt .\n```\n\n#### Phan\n\nMore info on how to run this tool can be found at: https://github.com/etsy/phan\n\n```\n$ docker run -it --rm -v \"$PWD\":/app -w /app adamculp/php-compatibility-check:latest \\\nphp vendor/bin/phan -l . --exclude-directory-list \"vendor/\" \\\n\u003e ./phan_results.txt\n```\n\nBy default Phan examines code in the following directories, plus what is specified in the command:\n\n```php\n'directory_list' =\u003e [\n        'src',\n        'tests/Phan',\n        'vendor/phpunit/phpunit/src',\n        'vendor/symfony/console',\n        '.phan/stubs',\n    ],\n```\n\nTo do otherwise it will require you to edit the Phan Phan/.phan/config.php file, and use the Alternative \nPreparations as indicated below.\n\n## Alternative Preparations\n\nRather than allowing Docker to retrieve the image from Docker Hub, users could also build the docker image locally \nby cloning the image repo from Github.\n\nWhy? As an example, a different version of PHP provided by including a different PHP image may be desired. Or a \nspecific version of the tools loaded by Composer might be required.\n\nAfter cloning, navigate to the location:\n\n```\n$ git clone https://github.com/adamculp/php-compatibility-check.git\n$ cd php-compatibility-check\n```\n\nAlter the Dockerfile as desired, then build the image locally:\n\n```\n$ docker build -t adamculp/php-compatibility-check .\n```\n\nOr a user may simply desire the image as-is, for later use:\n\n```\n$ docker build -t adamculp/php-compatibility-check https://github.com/adamculp/php-compatibility-check.git\n```\n\n## Enjoy!\n\nPlease star, on Docker Hub and/or Github, if you find this helpful.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamculp%2Fphp-compatibility-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamculp%2Fphp-compatibility-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamculp%2Fphp-compatibility-check/lists"}