{"id":13562768,"url":"https://github.com/shopsys/phpstorm-inspect","last_synced_at":"2025-04-30T14:09:26.244Z","repository":{"id":57049861,"uuid":"55765323","full_name":"shopsys/phpstorm-inspect","owner":"shopsys","description":"CLI tool to run PhpStorm inspections","archived":false,"fork":false,"pushed_at":"2018-04-05T09:03:39.000Z","size":36,"stargazers_count":42,"open_issues_count":2,"forks_count":7,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-19T03:34:21.871Z","etag":null,"topics":[],"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/shopsys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-08T09:00:22.000Z","updated_at":"2025-03-17T07:40:36.000Z","dependencies_parsed_at":"2022-08-23T19:10:23.258Z","dependency_job_id":null,"html_url":"https://github.com/shopsys/phpstorm-inspect","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopsys%2Fphpstorm-inspect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopsys%2Fphpstorm-inspect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopsys%2Fphpstorm-inspect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shopsys%2Fphpstorm-inspect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shopsys","download_url":"https://codeload.github.com/shopsys/phpstorm-inspect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251716815,"owners_count":21632187,"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":[],"created_at":"2024-08-01T13:01:12.097Z","updated_at":"2025-04-30T14:09:26.197Z","avatar_url":"https://github.com/shopsys.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# phpstorm-inspect\nThis package enables you to comfortably use PhpStorm as a CLI tool for static analysis.\n\nBasically, it is a wrapper for PhpStorm's `inspect.sh` script that does some extra work:\n* waits for PhpStorm to finish already running inspections (because PhpStorm cannot run more instances of `inspect.sh` in simultaneously; see [IDEA-150272](https://youtrack.jetbrains.com/issue/IDEA-150272))\n* clears PhpStorm's cache before every run in order to prevent stale cache issues (otherwise PhpStorm sometimes fails to see new files when switching GIT branches)\n* parses XML output generated by PhpStorm and presents it in a readable form (similar to tools like PHP CodeSniffer, PHPMD or PHP CS Fixer)\n\n## Usage\n```bash\nphp bin/phpstorm-inspect \u003cinspectShExecutableFilepath\u003e \u003cphpstormSystemPath\u003e \u003cprojectPath\u003e \u003cinspectionProfileFilepath\u003e \u003cinspectedDirectory\u003e [\u003cformat\u003e]\n```\n\n### Arguments description\n* `inspectShExecutableFilepath` - path to `inspect.sh` script\n* `phpstormSystemPath` - path to `.WebIde*/system` directory\n* `projectPath` - path to project directory (that contains `.idea` directory)\n* `inspectionProfileFilepath` - path to inspection profile XML file\n* `inspectedDirectory` - path in which are the inspected sources\n* `format (optional)` - format of output result, accepted values: \"text\" (default value) / \"checkstyle\"\n\n## Example (text format)\n```bash\nphp bin/phpstorm-inspect \\\n  /opt/PhpStorm-139.1348/bin/inspect.sh ~/.WebIde80/system \\\n  . .idea/inspectionProfiles/Project_Default.xml ./src\n```\n\n### Output\n```\nFile: /home/user/project/src/MyBundle/Controller/UserController.php\n--------------------------------------------------------------------------------\nFound 1 problems\n--------------------------------------------------------------------------------\nLine 17: Undefined field: Field 'usre' not found in class\n--------------------------------------------------------------------------------\n\nFile: /home/user/project/src/MyBundle/Controller/ArticleController.php\n--------------------------------------------------------------------------------\nFound 2 problems\n--------------------------------------------------------------------------------\nLine 26: Unused local variable: Unused local variable $articleId\nLine 32: Unreachable statement: Unreachable statement\n--------------------------------------------------------------------------------\n```\n\n## Example (checkstyle format)\n```bash\nphp bin/phpstorm-inspect \\\n  /opt/PhpStorm-139.1348/bin/inspect.sh ~/.WebIde80/system \\\n  . .idea/inspectionProfiles/Project_Default.xml ./src checkstyle \u003e report.xml\n```\n\n## Content of report.xml \n```\n\u003c?xml version=\"1.0\"?\u003e\n\u003ccheckstyle version=\"1.0.0\"\u003e\n    \u003cfile name=\"/home/user/project/src/MyBundle/Controller/UserController.php\"\u003e\n        \u003cerror line=\"17\" column=\"0\" severity=\"warning\" message=\"Undefined field: Field 'usre' not found in class\" /\u003e\n    \u003c/file\u003e\n    \u003cfile name=\"/home/user/project/src/MyBundle/Controller/ArticleController.php\"\u003e\n        \u003cerror line=\"26\" column=\"0\" severity=\"warning\" message=\"Unused local variable: Unused local variable $articleId\" /\u003e\n        \u003cerror line=\"32\" column=\"0\" severity=\"warning\" message=\"Unreachable statement: Unreachable statement\" /\u003e\n    \u003c/file\u003e\n\u003c/checkstyle\u003e\n```\n\n## FAQ / Issues\n### Why should I use this package when I can simply run the inspections from IDE?\nThis package comes handy in environments where you do not have graphical interface.\n\nFor example, you can run static code analysis on your Continuous Integration server (eg. Jenkins).\n\n### Does CLI inspections work when PhpStorm IDE is running?\nUnfortunately not. PhpStorm currently does not support running `inspect.sh` script when IDE is running. You need to close the IDE when you want to run inspections from CLI.\n\n### What PhpStorm versions are supported?\nThe package was tested with PhpStorm 8.0 (139.732) but the newer versions will probably work too.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshopsys%2Fphpstorm-inspect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshopsys%2Fphpstorm-inspect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshopsys%2Fphpstorm-inspect/lists"}