TYPO3 PSR-2 setup in your favourite PHP IDE

It's always good practice to write your code with TYPO3 PSR-2 standards of PHP, then why not just integrate to your favourite PHP IDE? To write better code everyday!

1. PHP Storm

Step 1. Go to File -> Settings -> Code style -> PHP and navigate to that menu

Step 2. Choose option of PSR1/PSR2


2. Visual Studio Code

Step 1. Ctrl+P Search ext install kokororin.vscode-phpfmt

Step 2. Install the extensions

Explore at https://marketplace.visualstudio.com/items?itemName=kokororin.vscode-phpfmt


3. Sublime

Option 1. Install PHPFMT

Step 1. Go to Package Controll (Ctrl + Shift + P)

Step 2. Search "Package Control: Install Package"

Step 3. Install "phpfmt"

Step 4. Go to Preferences -> Package Settings -> phpfmt -> Settings - Settings user

{
    "version": 4,
    "php_bin":"/usr/bin/php",
    "psr1": true,
    "psr2": true,
    "format_on_save":false,
    "option": "value"
}

Option 2. Install Sublime Linter

Step 1. Go to Package Controll (Ctrl + Shift + P)

Step 2. Search "Package Control: Install Package"

Step 3. Install following packages

SublimeLinter
SublimeLinter-php
SublimeLinter-phpcs

Step 4. Go to Preferences -> Package Settings -> SublimeLinter -> Settings

{
    "delay": 0.5,
    "linters": {
        "php": {
            "@disable": false,
            "args": [],
            "excludes": []
        },
        "phpcs": {
            "@disable": false,
            "args": [
                "-n"
            ],
            "excludes": [
                "*.phtml",
                "*.twig"
            ],
            "standard": "PSR2"
        }
    }
}

Post a Comment

×

Got answer to the question you were looking for?