Skip to content

Commit

Permalink
Merge pull request #1 from othillo/initial-version
Browse files Browse the repository at this point in the history
initial version
  • Loading branch information
wjzijderveld authored Jul 22, 2018
2 parents 8aa58cc + 3c7b402 commit dd89764
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .docheader.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* This file is part of the broadway/broadway package.
*
* (c) Qandidate.com <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/vendor/
composer.lock
11 changes: 11 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__);

return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
'declare_strict_types' => true,
])
->setFinder($finder);
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
broadway/coding-standard
========================

The coding standard of the Broadway project.

# Installation

```
$ composer require --dev broadway/coding-standard
```

# Configuration

## PHP CS fixer

1. create a `.php_cs` file referencing the `.php_cs.dist` template:

```php
# .php_cs

<?php

$config = require 'vendor/broadway/coding-standard/.php_cs.dist';

$config->setFinder(
\PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/test',
])
);

return $config;

```

2. add `.php_cs.cache` to your `.gitignore`.

## docheader

1. copy the `.docheader.dist` template:

```
cp vendor/broadway/coding-standard/.docheader.dist ./.docheader
```

2. modify the `.docheader` file is necessary.

# Usage

```
$ vendor/bin/php-cs-fixer fix --config=".php_cs" --allow-risky=yes --diff --verbose
$ vendor/bin/docheader check {src,test}
```
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"name": "broadway/coding-standard",
"description": "The coding standard of the Broadway project.",
"type": "metapackage",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "othillo",
"email": "[email protected]"
}
],
"require": {}
"require": {
"friendsofphp/php-cs-fixer": "^2.0",
"malukenho/docheader": "^0.1.7"
}
}

0 comments on commit dd89764

Please sign in to comment.