Skip to content

balanceinternet/coding-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magento coding standard

This is the default coding standard being used by Magento 2 core team.

Usage

I assume all of developers using PhpStorm or smiliar IDE to coding right now in Balance Internet. If you don't, you can contact me privately to get a key (legally) of it.

MacOS

Prerequisites

Homebrew installed

Q: Why Homebrew?

A-Short version: Why not?

A-Long version: It's apt-get/yum tool dedicated for MacOS

Installation

  • brew tap homebrew/homebrew-php
  • brew update
  • brew install php56 (php53 php54 php55 php70, your choices)
  • brew install php-code-sniffer (bonus brew install phpmd)

Set it up

  • Clone this repo to wherever you want
  • Symlink it to /usr/local/etc/php-code-sniffer/Standards

E.g:

$ git clone https://github.com/balanceinternet/coding-standard BalanceInternet_phpcs
$ ln -s BalanceInternet_phpcs/Magento /usr/local/etc/php-code-sniffer/Standards/BalanceM2

Q: Why symlink?

A: Version Control capabilities.

Integrate with PhpStorm

  • Navigate to Preferences > PHP > Code Sniffer
  • Set path to output of which phpcs and hit 'validate'
  • Navigate to Preferences > Inspections > PHP > PHP Code Sniffer validation and tick to enable
  • Refresh 'Coding Standards' dropdown and select your preferred options (BalanceM2 obviously)

About

Magento Coding Standards for Balance Internet developers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages