-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from othillo/initial-version
initial version
- Loading branch information
Showing
5 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/vendor/ | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |