Skip to content

Commit 8b5347f

Browse files
committed
prepare release
0 parents  commit 8b5347f

File tree

899 files changed

+32636
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

899 files changed

+32636
-0
lines changed

.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/tests export-ignore
2+
.gitattributes export-ignore
3+
.gitignore export-ignore
4+
.travis.yml export-
5+
phpunit.xml export-ignore
6+
*.md export-ignore

.github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
github: tomasvotruba
3+
custom: https://www.paypal.me/rectorphp

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vendor
2+
composer.lock

LICENSE

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
The MIT License
2+
---------------
3+
4+
Copyright (c) 2015 Tomas Votruba (http://tomasvotruba.com)
5+
6+
Permission is hereby granted, free of charge, to any person
7+
obtaining a copy of this software and associated documentation
8+
files (the "Software"), to deal in the Software without
9+
restriction, including without limitation the rights to use,
10+
copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the
12+
Software is furnished to do so, subject to the following
13+
conditions:
14+
15+
The above copyright notice and this permission notice shall be
16+
included in all copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25+
OTHER DEALINGS IN THE SOFTWARE.

README.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Coding Standard
2+
3+
[![Downloads](https://img.shields.io/packagist/dt/symplify/coding-standard.svg?style=flat-square)](https://packagist.org/packages/symplify/coding-standard/stats)
4+
5+
Set of rules for PHP_CodeSniffer, PHP-CS-Fixer and PHPStan used by Symplify projects.
6+
7+
**They run best with [EasyCodingStandard](https://github.com/symplify/easy-coding-standard)** and **PHPStan**.
8+
9+
## Install
10+
11+
```bash
12+
composer require symplify/coding-standard --dev
13+
composer require symplify/easy-coding-standard --dev
14+
```
15+
16+
1. Run with [ECS](https://github.com/symplify/easy-coding-standard):
17+
18+
```bash
19+
vendor/bin/ecs process src --set symplify
20+
```
21+
22+
or even better
23+
24+
```diff
25+
# ecs.php
26+
<?php
27+
28+
declare(strict_types=1);
29+
30+
use Symplify\EasyCodingStandard\ValueObject\Option;
31+
+use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
32+
33+
return static function (ContainerConfigurator $containerConfigurator): void {
34+
$parameters = $containerConfigurator->parameters();
35+
36+
+ $parameters->set(Option::SETS, [
37+
+ SetList::SYMPLIFY,
38+
+ ]);
39+
};
40+
```
41+
42+
2. Register rules for PHPStan:
43+
44+
```yaml
45+
# phpstan.neon
46+
includes:
47+
- vendor/symplify/coding-standard/config/symplify-rules.neon
48+
```
49+
50+
## Rules Overview
51+
52+
- [1. PHP_CodeSniffer sniffs](/docs/php_code_sniffer_sniffs.md)
53+
- [2. PHP CS Fixer fixers](/docs/phpcs_fixer_fixers.md)
54+
- [3. PHPStan rules](/docs/phpstan_rules.md)
55+
- [Object Calisthenics rules](/docs/phpstan_rules_object_calisthenics.md)
56+
- [Cognitive Complexity rules](/docs/phpstan_rules_cognitive_complexity.md)
57+
- ["No Arrays" rules](/docs/phpstan_rules_no_arrays.md)
58+
59+
<br>
60+
61+
## Contribute
62+
63+
The sources of this package are contained in the symplify monorepo. We welcome contributions for this package at [symplify/symplify](https://github.com/symplify/symplify).

composer.json

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "symplify/coding-standard",
3+
"description": "Set of Symplify rules for PHP_CodeSniffer and PHP CS Fixer.",
4+
"license": "MIT",
5+
"require": {
6+
"php": ">=7.2",
7+
"nette/utils": "^3.0",
8+
"nette/finder": "^2.5",
9+
"nikic/php-parser": "^4.10.2",
10+
"squizlabs/php_codesniffer": "^3.5",
11+
"slevomat/coding-standard": "^6.4",
12+
"friendsofphp/php-cs-fixer": "^2.16",
13+
"phpstan/phpstan": "^0.12.40",
14+
"symplify/package-builder": "^8.3.48",
15+
"symplify/symplify-kernel": "^8.3.48",
16+
"symplify/autowire-array-parameter": "^8.3.48"
17+
},
18+
"require-dev": {
19+
"nette/application": "^3.0",
20+
"nette/bootstrap": "^3.0",
21+
"symplify/easy-coding-standard-tester": "^8.3.48",
22+
"symplify/package-builder": "^8.3.48",
23+
"symplify/phpstan-extensions": "^8.3.48",
24+
"symfony/http-kernel": "^4.4|^5.1",
25+
"doctrine/orm": "^2.7",
26+
"symplify/smart-file-system": "^8.3.48",
27+
"symfony/framework-bundle": "^4.4|^5.1",
28+
"phpunit/phpunit": "^8.5|^9.0"
29+
},
30+
"autoload": {
31+
"psr-4": {
32+
"Symplify\\CodingStandard\\": "src",
33+
"Symplify\\CodingStandard\\CognitiveComplexity\\": "packages/cognitive-complexity/src",
34+
"Symplify\\CodingStandard\\ObjectCalisthenics\\": "packages/object-calisthenics/src"
35+
}
36+
},
37+
"autoload-dev": {
38+
"psr-4": {
39+
"Symplify\\CodingStandard\\Tests\\": "tests",
40+
"Symplify\\CodingStandard\\ObjectCalisthenics\\Tests\\": "packages/object-calisthenics/tests"
41+
}
42+
},
43+
"extra": {
44+
"branch-alias": {
45+
"dev-master": "8.4-dev"
46+
}
47+
},
48+
"minimum-stability": "dev",
49+
"prefer-stable": true
50+
}

config/config.php

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer;
6+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
7+
use Symplify\EasyCodingStandard\ChangedFilesDetector\ChangedFilesDetector;
8+
use Symplify\PackageBuilder\Reflection\PrivatesAccessor;
9+
10+
return static function (ContainerConfigurator $containerConfigurator): void {
11+
$services = $containerConfigurator->services();
12+
13+
$services->defaults()
14+
->public()
15+
->autowire()
16+
->autoconfigure();
17+
18+
$services->load('Symplify\CodingStandard\\', __DIR__ . '/../src')
19+
->exclude([
20+
__DIR__ . '/../src/TokenRunner/ValueObject',
21+
__DIR__ . '/../src/TokenRunner/Exception',
22+
__DIR__ . '/../src/Sniffs',
23+
__DIR__ . '/../src/Fixer',
24+
__DIR__ . '/../src/Rules',
25+
__DIR__ . '/../src/PHPStan',
26+
]);
27+
28+
$services->set(FunctionsAnalyzer::class);
29+
$services->set(PrivatesAccessor::class);
30+
31+
$services->set(ChangedFilesDetector::class);
32+
};

0 commit comments

Comments
 (0)