Skip to content

Commit 66e486a

Browse files
committed
Reformatted code (php-cs-fixer)
Added code standard, Added hooks git for code standard, Fixed parse where on null elements
1 parent 0f1f4e3 commit 66e486a

36 files changed

+9690
-7602
lines changed

.cs.php

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
return PhpCsFixer\Config::create()
4+
->setUsingCache(false)
5+
->setRiskyAllowed(true)
6+
//->setCacheFile(__DIR__ . '/.php_cs.cache')
7+
->setRules(array(
8+
'@PSR1' => true,
9+
'@PSR2' => true,
10+
'@Symfony' => true,
11+
'psr4' => true,
12+
// Custom rules
13+
'align_multiline_comment' => array('comment_type' => 'phpdocs_only'), // PSR-5
14+
'phpdoc_to_comment' => false,
15+
'array_indentation' => true,
16+
//'array_syntax' => ['syntax' => 'short'],
17+
'cast_spaces' => array('space' => 'none'),
18+
'concat_space' => array('spacing' => 'one'),
19+
'compact_nullable_typehint' => true,
20+
'declare_equal_normalize' => array('space' => 'single'),
21+
'increment_style' => array('style' => 'post'),
22+
'list_syntax' => array('syntax' => 'long'),
23+
'no_short_echo_tag' => true,
24+
'phpdoc_align' => false,
25+
'phpdoc_no_empty_return' => false,
26+
'phpdoc_order' => true, // PSR-5
27+
'phpdoc_no_useless_inheritdoc' => false,
28+
'protected_to_private' => false,
29+
'yoda_style' => false,
30+
'method_argument_space' => array('on_multiline' => 'ensure_fully_multiline'),
31+
'ordered_imports' => array(
32+
'sort_algorithm' => 'alpha',
33+
'imports_order' => array('class', 'const', 'function')
34+
),
35+
))
36+
->setFinder(PhpCsFixer\Finder::create()
37+
->in(__DIR__)
38+
->name('*.php')
39+
->ignoreDotFiles(true)
40+
->ignoreVCS(true));

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
**.logs
22
**.log
3-
.idea/**
3+
.idea/**
4+
vendor/**

0 commit comments

Comments
 (0)