Tuesday, June 23, 2015

PhpStorm settings

I like to use the following custom PhpStorm settings:

Global IDE Settings

  • Appearance & Behavior
    • System Settings
      - DONT reopen last project on startup
      - DONT confirm application exit
      - Open project in new window
  • Editor
    • Colors & Fonts
      • Font: Consolas 22pt (I have a 4K high DPI monitor)
    • Code Style
      Line separator: Unix
      Right margin (columns): 80
    • File Encodings
      Project Encoding: UTF-8
  • Languages & Frameworks
    • PHP
      PHP Executable: C:\dev\php\php.exe
      • Composer
        Path to composer.phar: C:\dev\bin\composer.phar

Per-Project Settings

For every project, it's also necessary to set up PHPUnit.

Note that I configure PHPUnit as a composer dependency, so each project has its own local copy and version of PHPUnit.

This removes the requirement that PHPUnit be installed on the system externally, but it also means that we have to configure PhpStorm when we first open the project.  That is the lesser of 2 evils IMO so that's what I'm doing.

Project Settings

  • Languages & Frameworks
    • PHP
      • PHPUnit
        Use custom autoloader
        Path to script: (current_dir)/vendor/autoload.php
        Default config file: (current_dir)/phpunit.xml.dist
        Default bootstrap file: (current_dir)/test/bootstrap.php

 Run > Edit Configurations

  • Defaults
    • PHPUnit
      • Test scope: Defined in the configuration file
      • Use alternative configuration file: (current_dir)/phpunit.xml.dist
      • Custom working directory: (current_dir)/test

No comments:

Post a Comment