{"id":15528142,"url":"https://github.com/brianhenryie/composer-phpstorm","last_synced_at":"2026-02-04T05:02:45.996Z","repository":{"id":71001926,"uuid":"238545725","full_name":"BrianHenryIE/composer-phpstorm","owner":"BrianHenryIE","description":"Auto-creates PhpStorm Run Configurations for PHP Unit and marks folders as excluded.","archived":false,"fork":false,"pushed_at":"2024-06-18T19:16:55.000Z","size":103,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T20:01:54.066Z","etag":null,"topics":["composer","phpstorm","phpunit"],"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/BrianHenryIE.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,"zenodo":null}},"created_at":"2020-02-05T20:49:30.000Z","updated_at":"2024-06-18T19:16:41.000Z","dependencies_parsed_at":"2025-05-14T23:11:24.372Z","dependency_job_id":"a37ff214-b2a1-4d47-9126-dcf7e28838c5","html_url":"https://github.com/BrianHenryIE/composer-phpstorm","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/BrianHenryIE/composer-phpstorm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianHenryIE%2Fcomposer-phpstorm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianHenryIE%2Fcomposer-phpstorm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianHenryIE%2Fcomposer-phpstorm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianHenryIE%2Fcomposer-phpstorm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrianHenryIE","download_url":"https://codeload.github.com/BrianHenryIE/composer-phpstorm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrianHenryIE%2Fcomposer-phpstorm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263233452,"owners_count":23434859,"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":["composer","phpstorm","phpunit"],"created_at":"2024-10-02T11:10:58.389Z","updated_at":"2026-02-04T05:02:40.951Z","avatar_url":"https://github.com/BrianHenryIE.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PHPCS PSR12](https://img.shields.io/badge/PHPCS-PSR%2012-f09f47.svg)](https://www.php-fig.org/psr/psr-12/)\n\n# Composer-PhpStorm\n\nAuto-creates PhpStorm Run Configurations for PHP Unit, marks folders as excluded, and configures WordPress integration.\n\n*Tested from PhpStorm 2019.3 to 2024.1.2*\n\n## Overview\n\n* **ExcludeFolders** marks specified folders, symlinked folders and [Mozart](https://github.com/coenjacobs/mozart) managed packages as excluded from PhpStorm code navigation and completion, by adding entries to the project's `.iml` configuration file\n* **PHPUnitRunConfigurations** creates a [Run Configuration](https://www.jetbrains.com/help/phpstorm/creating-run-debug-configuration-for-tests.html) for every `phpunit.xml` found in the project (ignoring `/vendor` and `/wp-content`), by adding entries to `workspace.xml`\n* **WordPress** searches for a WordPress install and enables WordPress support.\n\n## Installation\n\n\n```\ncomposer config allow-plugins.brianhenryie/composer-phpstorm true\ncomposer require --dev brianhenryie/composer-phpstorm\n```\n\nOptionally:\n\n```\n\"extra\": {\n \"phpstorm\": {\n  \"exclude_folders\": {\n  \t\"folders\": [\n   \t\t\"path/to/folder_one/from/project/base\",\n  \t\t\"path/to/folder_two/from/project/base\"    \n   ],\n   \"include_folders\": [\n  \t\t\"path/to/folder_one/from/project/base\",\n   ],\n   \"composer-symlinks\": false\n  }\n }\n}\n\n```\n\n## Operation\n\n### ExcludeFolders\n\nFolders to exclude can be specified under `extras/phpstorm/exclude_folders/folders`. These are assumed to be relative from the project root. \n\nPhpStorm automatically adds project folders inside the vendor folder to its excluded folders list, so adding them to the `folders` list doesn't achieve the desired effect. Instead, the `vendor/vendor-name/project/src` folder should be added to the `exculde_folders/folders` list and, counter-intuitively, `vendor/vendor-name/project/src` should be added to the `exculde_folders/include_folders` list.\n\nThe Composer tool [coenjacobs/mozart](https://github.com/coenjacobs/mozart), for prefixing package namespaces, results in each class being copied, thus each classname::function having multiple implementations in PhpStorm's code completion. This tool reads the Mozart Composer configuration and excludes source folders of packages managed by Mozart.\n\nThe file source of symlinks created by [kporras07/composer-symlinks](https://github.com/kporras07/composer-symlinks) are excluded if in the project directory. This can be disabled by setting `extras/phpstorm/exclude_folders/folders` to `false` in your `composer.json`. The file souce of a symlink is not excluded if it is in the root of the project.\n\nInside `/.idea/project-name.iml`'s `\u003ccomponent name=\"NewModuleRootManager\"\u003e \u003ccontent url=\"file://$MODULE_DIR$\"\u003e` adds:\n \n```\n\u003cexcludeFolder url=\"file://$MODULE_DIR$/foldertoexclude\"/\u003e\n```\n\n### PHPUnitRunConfigurations\n\nThe script searches the project directory for `phpunit.xml` and creates a PhpStorm Run Configuration for each one found (ignoring those under `/vendor/`), using the name `phpunit` when found in the project root folder and the folder name otherwise.\n\nInside `/.idea/workspace.xml`'s `\u003ccomponent name=\"RunManager\"\u003e` adds:\n\n```\n\u003cconfiguration name=\"tests\" type=\"PHPUnitRunConfigurationType\" factoryName=\"PHPUnit\"\u003e\n  \u003cTestRunner configuration_file=\"$PROJECT_DIR$/tests/phpunit.xml\" scope=\"XML\" use_alternative_configuration_file=\"true\"/\u003e\n  \u003cmethod v=\"2\"/\u003e\n\u003c/configuration\u003e\n```\n  \n## Why?\n\nWordPress. [I write many small plugins](https://github.com/BrianHenryIE/WordPress-Plugin-Boilerplate), this will click a few buttons for me that I don't much care for. \n\n## TODO\n\n* Symlinks could be searched for, then checked if they were pointing inside the project directory, rather than reading from composer.json\n* Set Default Interpreter (PHP Language Level/CLI Interpreter)\n* Configuration to allow excluding autodiscovered `phpunit.xml`s\n* Should find subpackages of those processed by Mozart \n* Set PHP language level\n* Set PHPCS, CBF, ~~WordPress path~~\n* Allow disabling Mozart integration\n* Automatically handle `vendor-name/project` folders in exclusion list but including that folder and excluding their `src` folder.\n* Should be one script and conditionally run parts based on config.\n* Consider [geecu/phpstorm-configurator](https://github.com/geecu/phpstorm-configurator/)\n\n## See Also\n\n* [BrianHenryIE/composer-fallback-to-git](https://github.com/BrianHenryIE/composer-fallback-to-git)\n* [BrianHenryIE/composer-prefer-local](https://github.com/BrianHenryIE/composer-prefer-local)\n\n## Acknowledgements\n\nI was waiting for MacOS Catalina to download and install. I learned how to write the Composer extension from reading [kporras07/composer-symlinks](https://github.com/kporras07/composer-symlinks).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianhenryie%2Fcomposer-phpstorm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianhenryie%2Fcomposer-phpstorm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianhenryie%2Fcomposer-phpstorm/lists"}