2017 © Pedro Peláez
 

library coding-standards

OXID eShop coding standards

image

oxid-esales/coding-standards

OXID eShop coding standards

  • Wednesday, June 6, 2018
  • by oxid
  • Repository
  • 25 Watchers
  • 8 Stars
  • 40,525 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 12 Versions
  • 10 % Grown

The README.md

OXID Coding Standards

This repository includes OXID eShop coding standards definition for PHP Codesniffer along with a PHPStorm autoformat config file. The PHP_CodeSniffer standard will never be 100% accurate, but should be viewed as a strong set of guidelines while contributing to OXID eShop., (*1)

See OXID eShop coding standards documentation at https://oxidforge.org/en/coding-standards.html, (*2)

Requirements

  • Latest Composer version

Installation

Coding Standards setup uses composer to get required packages, so make sure to have composer installed and accessible. You can find composer installation guide here., (*3)

Selecting where to install coding standards

Coding Standards can be installed directly within shop or to any other directory. However, installation varies slightly depending on selected location. We advise to install it using shop directory., (*4)

Option 1: Selecting shop directory for installation (preferred way)

To install Coding Standards within shop directory, update/create composer.json with following values:, (*5)

{
    "name": "oxid-esales/eshop",
    "description": "OXID eShop",
    "type": "project",
    "keywords": ["oxid", "modules", "eShop"],
    "homepage": "https://www.oxid-esales.com/en/home.html",
    "license": [
        "GPL-3.0",
        "proprietary"
    ],
    "repositories": {
        "oxid-esales/coding-standards": {
            "type": "vcs",
            "url": "https://github.com/OXID-eSales/coding_standards.git"
        },
        "squizlabs/php_codesniffer": {
            "type": "vcs",
            "url": "https://github.com/OXID-eSales/PHP_CodeSniffer.git"
        }
    },
    "require-dev": {
        "oxid-esales/coding-standards": "^2.0.0"
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

Installing this way, you can use phpcsoxid binary to check your shop directory for standards errors by shop/path/vendor/bin/phpcsoxid. Latest development shop version already includes composer.json file in its source, so no changes needs to be made., (*6)

Option 2: Selecting any directory for installation (alternative way)

To install Coding Standards to any directory, you need to checkout Coding Standards from Github into desired directory (git clone https://github.com/OXID-eSales/coding_standards.git). Installing this way, binaries will be accessible from coding_standards/bin. You must manually set what directory you want to check for conding standards errors by giving directory path as argument for oxid phpcs binary, like: phpcsoxid /path/to/my/shop/., (*7)

Installing Coding Standards

After you selected where you want to install the Coding Standards, follow these steps:, (*8)

  1. Navigate to the directory that you picked for installation.
  2. Use composer to setup Coding Standards components (composer install). Ensure you do this from within the directory where composer.json is located.

Running Coding Standards checks

To run coding standards checkings, use phpcsoxid binary by:
phpcsoxid - run phpcs with preconfigured Oxid standard, and show list of errors.
phpcsoxid /some/other/path - run phpcs with preconfigured Oxid standard on some specific directory
(You must always provide directory for checking if coding standards was not installed by "Option 1" installation method.), (*9)

It is possible to use standard codesniffer(phpcs) options too, like:
phpcsoxid --report=summary, (*10)

Alternatively, it is possible to use original phpcs, but you must configure it by yourself. As example:
phpcs --standard=/path/to/Standard/directory/Oxid/ /path/to/directory/for/checking/standards, (*11)

The Versions

06/06 2018

dev-master

9999999-dev https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0 GPL-3.0-only

The Requires

 

standards eshop oxid

06/06 2018

v3.0.5

3.0.5.0 https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0-only

The Requires

 

standards eshop oxid

13/02 2018

v3.0.4

3.0.4.0 https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0-only

The Requires

 

standards eshop oxid

19/01 2018

dev-pr15

dev-pr15 https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0

The Requires

 

standards eshop oxid

12/01 2018

dev-include_vendor_oxidsales

dev-include_vendor_oxidsales https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0

The Requires

 

standards eshop oxid

18/07 2017

dev-include_summernote-ESDEV-4666

dev-include_summernote-ESDEV-4666 https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0

The Requires

 

standards eshop oxid

18/07 2017

v3.0.3

3.0.3.0 https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0

The Requires

 

standards eshop oxid

02/06 2017

v3.0.2

3.0.2.0 https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0

The Requires

 

standards eshop oxid

16/12 2016

v2.x-dev

2.9999999.9999999.9999999-dev https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0

The Requires

 

standards eshop oxid

16/12 2016

v2.0.3

2.0.3.0 https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0

The Requires

 

standards eshop oxid

16/12 2016

v3.0.1

3.0.1.0 https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0

The Requires

 

standards eshop oxid

24/03 2015

2.0.0

2.0.0.0 https://www.oxid-esales.com/en/home.html

OXID eShop coding standards

  Sources   Download

GPL-3.0

The Requires

 

standards eshop oxid