Coding Standards

The shopware team uses the following coding standards. All contributions to Shopware as well as plugins and customizations should also use these standards.

GeneralAnchor link for: general

If not stated otherwise we use the following coding styles for all source files:

  • Unix-like newlines (Line Feed/LF, \n)
  • 4 spaces for indenting, not tabs
  • UTF-8 File encoding

PHP Coding StandardAnchor link for: php coding standard

For PHP Code all contributions should use the PSR-1: Basic Coding Standard and PSR-2: Coding Style Guide.

You can automatically check and fix the coding style with php-cs-fixer:

./vendor/bin/php-cs-fixer fix -v

The configuration for php-cs-fixer can be found in /.php_cs.dist.

JavaScript Coding StandardAnchor link for: javascript coding standard

Please see our dedicated page for the JavaScript Coding Standard.

CSS Coding GuidelinesAnchor link for: css coding guidelines

Please see the following blog post for the CSS Coding Guidelines.

Smarty / HTML Coding GuidelinesAnchor link for: smarty / html coding guidelines

Please see our dedicated page for the Smarty / HTML Coding Guidelines.

Top