PHP code example of phpcsstandards / phpcsdevtools
1. Go to this page and download the library: Download phpcsstandards/phpcsdevtools library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phpcsstandards / phpcsdevtools example snippets
bash
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer global
Ptr | Ln | Col | Cond | ( #) | Token Type | [len]: Content
-------------------------------------------------------------------------
0 | L1 | C 1 | CC 0 | ( 0) | T_OPEN_TAG | [ 5]:
1 | L2 | C 1 | CC 0 | ( 0) | T_WHITESPACE | [ 0]:
2 | L3 | C 1 | CC 0 | ( 0) | T_COMMENT | [ 32]: // Boolean not operator: All OK.
3 | L4 | C 1 | CC 0 | ( 0) | T_IF | [ 2]: if
4 | L4 | C 3 | CC 0 | ( 0) | T_WHITESPACE | [ 1]: ⸱
5 | L4 | C 4 | CC 0 | ( 0) | T_OPEN_PARENTHESIS | [ 1]: (
6 | L4 | C 5 | CC 0 | ( 1) | T_WHITESPACE | [ 1]: ⸱
7 | L4 | C 6 | CC 0 | ( 1) | T_CONSTANT_ENCAPSED_STRING | [ 4]: 'bb'
8 | L4 | C 10 | CC 0 | ( 1) | T_WHITESPACE | [ 1]: ⸱
9 | L4 | C 11 | CC 0 | ( 1) | T_IS_NOT_IDENTICAL | [ 3]: !==
10 | L4 | C 14 | CC 0 | ( 1) | T_WHITESPACE | [ 1]: ⸱
11 | L4 | C 15 | CC 0 | ( 1) | T_CONSTANT_ENCAPSED_STRING | [ 4]: 'bb'
12 | L4 | C 19 | CC 0 | ( 1) | T_WHITESPACE | [ 1]: ⸱
13 | L4 | C 20 | CC 0 | ( 0) | T_CLOSE_PARENTHESIS | [ 1]: )
14 | L4 | C 21 | CC 0 | ( 0) | T_WHITESPACE | [ 1]: ⸱
15 | L4 | C 22 | CC 0 | ( 0) | T_OPEN_CURLY_BRACKET | [ 1]: {
16 | L4 | C 23 | CC 0 | ( 0) | T_WHITESPACE | [ 0]:
17 | L5 | C 1 | CC 0 | ( 0) | T_WHITESPACE | [ 1]: →
18 | L5 | C 2 | CC 0 | ( 0) | T_IF | [ 2]: if
19 | L5 | C 4 | CC 0 | ( 0) | T_WHITESPACE | [ 1]: ⸱
20 | L5 | C 5 | CC 0 | ( 0) | T_OPEN_PARENTHESIS | [ 1]: (
21 | L5 | C 6 | CC 0 | ( 0) | T_WHITESPACE | [ 0]: