Skip to content

Commit ec6191f

Browse files
committed
Add phpcs configuration
See phpmyadmin/sql-parser#112 Signed-off-by: Michal Čihař <michal@cihar.com>
1 parent 9d34cfa commit ec6191f

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
composer.phar
22
composer.lock
33
/vendor/
4+
.php_cs.cache

.php_cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
// see https://github.com/FriendsOfPHP/PHP-CS-Fixer
4+
5+
$finder = PhpCsFixer\Finder::create()
6+
->in(array(__DIR__.'/src', __DIR__.'/tests', __DIR__.'/examples'))
7+
;
8+
9+
return PhpCsFixer\Config::create()
10+
->setRules(array(
11+
'@PSR1' => true,
12+
'@PSR2' => true,
13+
'@Symfony' => true,
14+
'array_syntax' => array('syntax' => 'long'),
15+
'phpdoc_order' => true,
16+
'no_trailing_whitespace' => true,
17+
'concat_space' => array('spacing' => 'one'),
18+
))
19+
->setFinder($finder)
20+
;

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"ext-dbase": "For dbf files parsing"
2323
},
2424
"require-dev": {
25-
"phpunit/phpunit": "~5.2 || ~4.8"
25+
"phpunit/phpunit": "~5.2 || ~4.8",
26+
"friendsofphp/php-cs-fixer": "^2.0"
2627
},
2728
"autoload": {
2829
"psr-4": {

0 commit comments

Comments
 (0)