plan2net / phpstorm-code-style

PhpStorm Code style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PhpStorm Code style settings

Description

  • PHP: based on Symfony2

    • empty line before the return statement
    • no comma after last array item
  • JavaScript/Typescript: based on JavaScript Standard Style

    • indent 4 spaces
    • semi-colons
    • chained indented calls
  • vue.js Components (.vue)

    • same as Typescript
  • SCSS/LESS: based on PhpStorm Default

    • indent 4 spaces
  • HTML: based on PhpStorm Default

    • Wrap attributes = Chop down if long

Import

IDE

  1. File > Settings

  2. Editor > Code Style

  3. Select the three dots next to Scheme

  4. Select Import Scheme …

  5. Select IntelliJ Idea Code Style XML

  6. Select the XML file and import

  7. File > Settings

  8. Editor > Inspections

  9. Select the three dots next to Profile

  10. Select Import Profile …

  11. Select Profile Default.xml

  12. Select the XML file and import

Project

  1. Open your project
  2. Follow steps 1-3 as above
  3. Select Copy to Project … and confirm the following dialog (Overwrite)
  4. Apply the new styles to your project

PhpStorm Inspections settings

  • PHP: ignore PHPDoc comments if type hints are sufficient

Import

IDE

  1. File > Settings
  2. Editor > Inspections
  3. Select the three dots next to Profile
  4. Select Import Profile …
  5. Select Profile Default.xml
  6. Select the XML file and import

About

PhpStorm Code style