Translations
Info
All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

Development/PHPStorm Settings

From TYPO3Wiki
Jump to: navigation, search

[WIP] This article describes the settings you should apply to your PHPStorm IDE to avoid common mistakes. While these seem minor at first sight, they ease the work on our QA department and help big time to not let the core decay over time in regards to Code quality and consistency.

Code Style

TYPO3 uses PSR-2 as Coding Style for PHP. To set that in PHPStorm:

  1. Open Settings (or Default Settings, if you want to set this for all projects)
  2. Go to Editor -> Code Style -> PHP
  3. Click on "Set from..." (Looks like a link on the top right of the settings window)
  4. Choose "Predefined Style > PSR1/2"

Autocomplete for factory methods (makeInstance, ObjectManager->get) in PHPStorm

The TYPO3 core comes with a configuration file for the dynamic return type plugin that gives you autocomplete for factory methods like GeneralUtility::makeInstance and ObjectManager->get. To install the plugin in PHPStorm follow these steps:

  1. Open Settings
  2. Go to plugins
  3. Click the "Browse repositories" button
  4. Enter "dynamicReturnTypePlugin" in the search box
  5. Install the plugin
  6. The configuration will be loaded automatically


FYI: The configuration file: https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/dynamicReturnTypeMeta.json (If your TYPO3 version does not have this file you can download it and just add it to your project.)