PHPackages                             paysera/util-phpstorm-helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. paysera/util-phpstorm-helper

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

paysera/util-phpstorm-helper
============================

Helper to set-up shared PhpStorm configuration

1.0.8(5y ago)2172[1 issues](https://github.com/paysera/util-phpstorm-helper/issues)MITPHPPHP &gt;=7.2

Since Aug 7Pushed 5y ago2 watchersCompare

[ Source](https://github.com/paysera/util-phpstorm-helper)[ Packagist](https://packagist.org/packages/paysera/util-phpstorm-helper)[ RSS](/packages/paysera-util-phpstorm-helper/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (8)Dependencies (11)Versions (11)Used By (0)

PhpStorm helper
===============

[](#phpstorm-helper)

[![Latest Version](https://camo.githubusercontent.com/0f85e87a1326dcbe8dfa0c7f0cedcf17b98406ece2f325622ef8bdfb396a8ab3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f706179736572612f7574696c2d70687073746f726d2d68656c7065723f7374796c653d666c61742d737175617265)](https://github.com/paysera/util-phpstorm-helper/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/85d6caa85e1256a9e7252e28a1c44a62bb75825ff4e4c6a43a3a3d4e5f87d16a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f706179736572612f7574696c2d70687073746f726d2d68656c7065722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/paysera/util-phpstorm-helper)[![Coverage Status](https://camo.githubusercontent.com/86428dfb39b58e060e3e7b84997ed23edf546e6608f39edaae9e3a82fed7b3b0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f706179736572612f7574696c2d70687073746f726d2d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/paysera/util-phpstorm-helper/code-structure)[![Quality Score](https://camo.githubusercontent.com/ed76c70a2bf93c5c631c730104e0564e0d7486735fc5c584960a6b474ecb1446/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f706179736572612f7574696c2d70687073746f726d2d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/paysera/util-phpstorm-helper)

Scripts to set-up PhpStorm with shared configuration.

Why?
----

[](#why)

Each of us like to customise our developer experience – shortcuts, layout and other tremendously important things like color schemes. But some of the configuration is usually best to be shared with other team members:

- customized code style, inspections, generated code templates;
- directories configured by project's structure;
- correct SQL dialect;
- some plugins enabled for the project;
- PHP interpreter as docker with correct image;
- integration with any quality control tools;
- external tools available to run;
- configuration for servers to allow debugging;
- some common plugins to be installed.

This allows more consistency in your team and avoids configuring everything for each member separately.

There is `Settings repository` feature in PhpStorm, but it does not synchronize most of such things, and it does synchronize some stuff that's supposed to be private (like color scheme).

There are also three different places where this configuration should be changed:

- in `.idea` folder – files, that can be versioned. This library helps to make initial configuration easier;
- in `.idea` folder, but in file, which should not be versioned. This requires script to be ran in each machine to modify that file;
- in global PhpStorm configuration files – installed plugins and external tools. These are shared for all projects.

Installation
------------

[](#installation)

Download latest release of `phpstorm-helper.phar` from [releases page](https://github.com/paysera/util-phpstorm-releases/releases).

Automated:

```
curl -sLo phpstorm-helper https://github.com/paysera/util-phpstorm-helper/releases/download/1.0.0/phpstorm-helper.phar
chmod +x phpstorm-helper
./phpstorm-helper self-update
sudo mv phpstorm-helper /usr/local/bin/phpstorm-helper

```

You will also need zip library to download and extract the plugins. To install on Ubuntu:

```
sudo apt-get install php-zip
```

Usage
-----

[](#usage)

### TL;DR;

[](#tldr)

Once (better to run when PhpStorm is closed):

```
phpstorm-helper configure-installation
```

For each project:

- Close project

```
phpstorm-helper configure
```

- Reopen project

Or, with more options:

```
phpstorm-helper configure --docker-image php-cli:7.4 --webpack-config-path config/webpack.js --server project-url-address.docker:80@/project-path-inside/container
```

Following runs for the same project can skip the options unless you want to change any of those.

### Commands

[](#commands)

As you already noted, there are 2 different use-cases:

- setting up (possibly) versioned configuration files in `.idea` and modifying `workspace.xml`(which cannot be versioned). Library provides the defaults used for repositories made by Paysera – feel free to use those or customise with your own;
- configuring external tools and installing common plugins, which is done in PhpStorm installation folder.

### Setting up versioned configuration files

[](#setting-up-versioned-configuration-files)

```
phpstorm-helper configure [project-root-dir] [path-to-configuration-template-structure]
```

Features of default configuration:

- customized code style and generated code templates to be compatible with [Paysera style guide](https://github.com/paysera/php-style-guide);
- customized inspections – some disabled, some optional ones enabled;
- MariaDB SQL dialect;
- Symfony plugin enabled for the project;
- service names for Symfony service generation follows the conventions;
- directories are marked as they should:
    - vendor directories not added as Git roots – no git update is called for libraries after Project update;
    - generated files are marked as excluded – you won't see duplicated find results;
    - configuration for vendors – vendors are excluded, but inside include path. This makes Scopes with following configuration:
        - `Project Files` (or `In Project`) – vendors are not included;
        - `Project and Libraries` – vendors are included. Choose `Scope → Project and Libraries` when searching;
- PHP interpreter as docker with correct image. This allows to run unit tests using PhpStorm integration in the right environment;
- `php-cs-fixer` integration – if something's wrong, it will be marked as Weak Warning.

Some features require additional options or already existing files (like `.php_cs`) in current directory. Run with `--help` for more information.

### Configuring external tools and installing plugins

[](#configuring-external-tools-and-installing-plugins)

```
phpstorm-helper configure-installation [path-to-config-file]
```

`path-to-config-file` is path to `php` configuration file, which has the following structure:

```
