Skip to content

Commit 7758b48

Browse files
author
Tobias Wojtylak
committed
Init commit: Added configuration from morpheus
1 parent ef89a83 commit 7758b48

File tree

5 files changed

+201
-1
lines changed

5 files changed

+201
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/composer.lock
2+
/vendor/

.travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
language: php
2+
3+
php:
4+
- 7.1
5+
- 7.2
6+
7+
env:
8+
- ECS_VERSION=2.5.*
9+
- ECS_VERSION=3.2.*
10+
11+
cache:
12+
directories:
13+
- ~/.composer/cache/files
14+
15+
before_install:
16+
- phpenv config-rm xdebug.ini || true
17+
18+
install:
19+
- composer require symplify/easy-coding-standard:${ECS_VERSION} --no-update --no-scripts --prefer-dist
20+
- composer update --prefer-dist
21+
22+
script:
23+
- composer validate --strict
24+
25+
- vendor/bin/ecs check tests

README.md

100644100755
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
# CodingStandard
1+
<h1 align="center">
2+
solutionDrive Coding Standard
3+
</h1>
4+
5+
:1st_place_medal: solutionDrive coding standard configuration.
6+
7+
Installation & usage
8+
--------------------
9+
10+
1. Install this package:
11+
12+
```bash
13+
$ composer require --dev solutionDrive/coding-standard
14+
```
15+
16+
2. Include a configuration file in your `easy-coding-standard.neon`:
17+
18+
```neon
19+
includes:
20+
- vendor/solutionDrive/coding-standard/easy-coding-standard.neon
21+
```

composer.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "solutionDrive/coding-standard",
3+
"description": "solutionDrive coding standard.",
4+
"license": "MIT",
5+
"require": {
6+
"php": "^7.1",
7+
8+
"symplify/easy-coding-standard": "^2.5|^3.2"
9+
}
10+
}

easy-coding-standard.neon

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
includes:
2+
- /composer/vendor/symplify/easy-coding-standard/config/php_codesniffer/psr2.neon
3+
- /composer/vendor/symplify/easy-coding-standard/config/php_cs_fixer/psr2.neon
4+
- /composer/vendor/symplify/easy-coding-standard/config/clean-code.neon
5+
6+
checkers:
7+
PhpCsFixer\Fixer\Operator\ConcatSpaceFixer:
8+
spacing: one
9+
- PhpCsFixer\Fixer\Operator\NewWithBracesFixer
10+
11+
PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer:
12+
tags: [ param ]
13+
14+
- PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer
15+
- PhpCsFixer\Fixer\CastNotation\CastSpacesFixer
16+
- PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer
17+
- PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer
18+
- PhpCsFixer\Fixer\Comment\HashToSlashCommentFixer
19+
- PhpCsFixer\Fixer\ControlStructure\IncludeFixer
20+
- PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer
21+
- PhpCsFixer\Fixer\ClassNotation\MethodSeparationFixer
22+
- PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer
23+
- PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer
24+
- PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer
25+
- PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer
26+
- PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer
27+
- PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer
28+
PhpCsFixer\Fixer\Whitespace\NoExtraConsecutiveBlankLinesFixer:
29+
- curly_brace_block
30+
- extra
31+
- parenthesis_brace_block
32+
- square_brace_block
33+
- throw
34+
- use
35+
- PhpCsFixer\Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer
36+
- PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer
37+
- PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer
38+
- PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer
39+
- PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer
40+
- PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer
41+
- PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer
42+
- PhpCsFixer\Fixer\ArrayNotation\TrailingCommaInMultilineArrayFixer
43+
- PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer
44+
- PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer
45+
- PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer
46+
- PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer
47+
- PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer
48+
- PhpCsFixer\Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer
49+
- PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer
50+
- PhpCsFixer\Fixer\Phpdoc\PhpdocInlineTagFixer
51+
- PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer
52+
- PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer
53+
- PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer
54+
- PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer
55+
- PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer
56+
- PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer
57+
- PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer
58+
- PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer
59+
- PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer
60+
- PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer
61+
- PhpCsFixer\Fixer\Operator\PreIncrementFixer
62+
PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer:
63+
space_before: none
64+
65+
- PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer
66+
- PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer
67+
- PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer
68+
- PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer
69+
- PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer
70+
- PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer
71+
- PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer
72+
- PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer
73+
PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer:
74+
singleLine: true
75+
- PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer
76+
- PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer
77+
PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer:
78+
use: echo
79+
- PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer
80+
- PhpCsFixer\Fixer\Phpdoc\PhpdocNoAliasTagFixer
81+
- PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer
82+
- PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer
83+
- PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer
84+
85+
# new since PHP-CS-Fixer 2.6
86+
- PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer
87+
- PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer
88+
- PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer
89+
- PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer
90+
91+
92+
PhpCsFixer\Fixer\Alias\RandomApiMigrationFixer:
93+
mt_rand: random_int
94+
rand: random_int
95+
96+
# declare(strict_types=1)
97+
- PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer
98+
99+
# Typehints
100+
- PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer
101+
- PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer
102+
SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff:
103+
usefulAnnotations:
104+
- @todo
105+
- @dataProvider
106+
enableEachParameterAndReturnInspection: true
107+
108+
# Throwable
109+
- SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff
110+
111+
PhpCsFixer\Fixer\Comment\HeaderCommentFixer:
112+
header:
113+
"""
114+
Created by solutionDrive GmbH
115+
116+
@copyright 2018 solutionDrive GmbH
117+
"""
118+
location: after_declare_strict
119+
120+
## some further sniffs, let's discuss them
121+
# # force blank line after <?php
122+
# - PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer
123+
# # force blank line before break, return, throw, ...
124+
# - PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer
125+
# # fix spaces around => and =
126+
# PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer:
127+
# align_double_arrow: true
128+
# align_equals: true
129+
130+
131+
parameters:
132+
skip_codes:
133+
SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff.UselessDocComment:
134+
- *tests/*
135+
PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff.NoLineAfterClose:
136+
- *
137+
138+
139+
## usage example:
140+
#parameters:
141+
# skip:
142+
# PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\ControlStructureSpacingSniff:
143+
# - src/Kernel.php

0 commit comments

Comments
 (0)