Skip to content

Commit dd89764

Browse files
authored
Merge pull request #1 from othillo/initial-version
initial version
2 parents 8aa58cc + 3c7b402 commit dd89764

File tree

5 files changed

+79
-2
lines changed

5 files changed

+79
-2
lines changed

.docheader.dist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* This file is part of the broadway/broadway package.
3+
*
4+
* (c) Qandidate.com <opensource@qandidate.com>
5+
*
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
*/

.gitignore

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

.php_cs.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__);
5+
6+
return PhpCsFixer\Config::create()
7+
->setRules([
8+
'@Symfony' => true,
9+
'declare_strict_types' => true,
10+
])
11+
->setFinder($finder);

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
broadway/coding-standard
2+
========================
3+
4+
The coding standard of the Broadway project.
5+
6+
# Installation
7+
8+
```
9+
$ composer require --dev broadway/coding-standard
10+
```
11+
12+
# Configuration
13+
14+
## PHP CS fixer
15+
16+
1. create a `.php_cs` file referencing the `.php_cs.dist` template:
17+
18+
```php
19+
# .php_cs
20+
21+
<?php
22+
23+
$config = require 'vendor/broadway/coding-standard/.php_cs.dist';
24+
25+
$config->setFinder(
26+
\PhpCsFixer\Finder::create()
27+
->in([
28+
__DIR__ . '/src',
29+
__DIR__ . '/test',
30+
])
31+
);
32+
33+
return $config;
34+
35+
```
36+
37+
2. add `.php_cs.cache` to your `.gitignore`.
38+
39+
## docheader
40+
41+
1. copy the `.docheader.dist` template:
42+
43+
```
44+
cp vendor/broadway/coding-standard/.docheader.dist ./.docheader
45+
```
46+
47+
2. modify the `.docheader` file is necessary.
48+
49+
# Usage
50+
51+
```
52+
$ vendor/bin/php-cs-fixer fix --config=".php_cs" --allow-risky=yes --diff --verbose
53+
$ vendor/bin/docheader check {src,test}
54+
```

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"name": "broadway/coding-standard",
33
"description": "The coding standard of the Broadway project.",
4-
"type": "metapackage",
4+
"type": "library",
55
"license": "MIT",
66
"authors": [
77
{
88
"name": "othillo",
99
"email": "othillo@othillo.nl"
1010
}
1111
],
12-
"require": {}
12+
"require": {
13+
"friendsofphp/php-cs-fixer": "^2.0",
14+
"malukenho/docheader": "^0.1.7"
15+
}
1316
}

0 commit comments

Comments
 (0)