Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 22bf269

Browse files
authored
Merge pull request magento#390 from magento/coding-standards_jf
MAGETWO-57282 Coding standards jf
2 parents 6bdffa6 + 8a3efc6 commit 22bf269

8 files changed

+37
-6
lines changed

guides/v2.0/coding-standards/bk-coding-standards.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ To code extensions, follow the Magento standards for code:
2121

2222
- [Code demarcation standard]({{page.baseurl}}coding-standards/code-standard-demarcation.html)
2323
- [PHP coding standard]({{page.baseurl}}coding-standards/code-standard-php.html)
24+
- [PHP code sniffers]({{page.baseurl}}coding-standards/code-standard-sniffers.html)
2425
- [JavaScript coding standard]({{page.baseurl}}coding-standards/code-standard-javascript.html)
2526
- [jQuery widget coding standard]({{page.baseurl}}coding-standards/code-standard-jquery-widgets.html)
2627
- [DocBlock standard]({{page.baseurl}}coding-standards/docblock-standard-general.html)

guides/v2.0/coding-standards/code-standard-html.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group: coding-standards
44
subgroup: Coding standards
55
title: HTML style guide
66
menu_title: HTML style guide
7-
menu_order: 8
7+
menu_order: 9
88
version: 2.0
99
github_link: coding-standards/code-standard-html.md
1010
---

guides/v2.0/coding-standards/code-standard-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group: coding-standards
44
subgroup: Coding standards
55
title: JavaScript coding standard
66
menu_title: JavaScript coding standard
7-
menu_order: 4
7+
menu_order: 5
88
version: 2.0
99
github_link: coding-standards/code-standard-javascript.md
1010
redirect_from: /guides/v1.0/coding-standards/code-standard-javascript.html

guides/v2.0/coding-standards/code-standard-jquery-widgets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group: coding-standards
44
subgroup: Coding standards
55
title: jQuery widget coding standard
66
menu_title: jQuery widget coding standard
7-
menu_order: 6
7+
menu_order: 7
88
version: 2.0
99
github_link: coding-standards/code-standard-jquery-widgets.md
1010
redirect_from: /guides/v1.0/coding-standards/code-standard-jquery-widgets.html

guides/v2.0/coding-standards/code-standard-less.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group: coding-standards
44
subgroup: Coding standards
55
title: LESS coding standard
66
menu_title: LESS coding standard
7-
menu_order: 7
7+
menu_order: 8
88
version: 2.0
99
github_link: coding-standards/code-standard-less.md
1010
---
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
layout: default
3+
group: coding-standards
4+
subgroup: Coding standards
5+
title: Code sniffers
6+
menu_title: PHP code sniffers
7+
menu_order: 3
8+
version: 2.0
9+
github_link: coding-standards/code-standard-sniffers.md
10+
---
11+
12+
## PHP code sniffers
13+
14+
We recommend the consistent use of a <i>code sniffer</i> to enhance the readability of your code and help ensure that it meets Magento code standards. A code sniffer is a tool that automates the process of identifying code irregularities. Although a sniffer will identify many more inconsistencies and errors than a manual edit, we recommend that you evaluate and make any fixes that your sniffer program identifies.
15+
16+
Magento recommends the use of <a href="http://pear.php.net/manual/en/package.php.php-codesniffer.faq.php" target="_blank">PHP_CodeSniffer</a>, the most popular code sniffer in use throughout the PHP development community. PHP_CodeSniffer implements the full PSR4 standard. You can extend PHP_CodeSniffer to include your own rules, too, <a href="https://github.com/magento/magento2/blob/develop/dev/tests/static/framework/Magento/ruleset.xml" target="_blank">as we have</a>. The <a href="https://github.com/magento-ecg/coding-standard" target="_blank">ECG Magento PHP Code Sniffer Coding Standard</a> provides specifications that you can use to configure your code sniffer of choice to bring your <i>PHP coding style closer to Magento PHP standards</i>.
17+
18+
19+
20+
### Code standards
21+
22+
Magento supports the full <a href="http://stackoverflow.com/questions/24868586/what-is-the-difference-between-psr-0-and-psr-4983" target="_blank">PSR4</a> standard plus some Magento-specific coding practices.
23+
24+
25+
The <a href="http://devdocs.magento.com/guides/v2.0/coding-standards/bk-coding-standards.html" target="_blank">Coding standards overview</a> introduces Magento-specific practices for PHP, JavaScript, and JQuery.
26+
27+
28+
29+
30+

guides/v2.0/coding-standards/docblock-standard-general.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group: coding-standards
44
subgroup: Coding standards
55
title: DocBlock standard
66
menu_title: DocBlock standard
7-
menu_order: 3
7+
menu_order: 4
88
version: 2.0
99
github_link: coding-standards/docblock-standard-general.md
1010
redirect_from: /guides/v1.0/coding-standards/docblock-standard-general.html

guides/v2.0/coding-standards/docblock-standard-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group: coding-standards
44
subgroup: Coding standards
55
title: JavaScript DocBlock standard
66
menu_title: JavaScript DocBlock standard
7-
menu_order: 5
7+
menu_order: 6
88
version: 2.0
99
github_link: coding-standards/docblock-standard-javascript.md
1010
redirect_from: /guides/v1.0/coding-standards/docblock-standard-javascript.html

0 commit comments

Comments
 (0)