-
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Coding Standards aligned with other projects (#120)
* Make rule and deps * CS applied
- Loading branch information
Showing
19 changed files
with
3,440 additions
and
465 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,61 @@ | ||
<?php | ||
|
||
$header = 'The MIT License (MIT) | ||
Copyright (c) 2014-2018 Spomky-Labs | ||
This software may be modified and distributed under the terms | ||
of the MIT license. See the LICENSE file for details.'; | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__.'/src') | ||
->in(__DIR__.'/tests') | ||
; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
'@PSR1' => true, | ||
'@PSR2' => true, | ||
'@Symfony' => true, | ||
'@DoctrineAnnotation' => true, | ||
'@PHP70Migration' => true, | ||
'@PHP71Migration' => true, | ||
'strict_param' => true, | ||
'strict_comparison' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'array_indentation' => true, | ||
'ordered_imports' => true, | ||
'protected_to_private' => true, | ||
'declare_strict_types' => true, | ||
'native_function_invocation' => [ | ||
'include' => ['@compiler_optimized'], | ||
'scope' => 'namespaced', | ||
], | ||
'mb_str_functions' => true, | ||
'method_chaining_indentation' => true, | ||
'linebreak_after_opening_tag' => true, | ||
'combine_consecutive_issets' => true, | ||
'combine_consecutive_unsets' => true, | ||
'compact_nullable_typehint' => true, | ||
'no_superfluous_phpdoc_tags' => true, | ||
'no_superfluous_elseif' => true, | ||
'phpdoc_trim_consecutive_blank_line_separation' => true, | ||
'phpdoc_order' => true, | ||
'pow_to_exponentiation' => true, | ||
'simplified_null_return' => true, | ||
'header_comment' => [ | ||
'header' => $header, | ||
], | ||
'align_multiline_comment' => [ | ||
'comment_type' => 'all_multiline', | ||
], | ||
'php_unit_test_annotation' => [ | ||
'case' => 'snake', | ||
'style' => 'annotation', | ||
], | ||
'php_unit_test_case_static_method_calls' => true, | ||
]) | ||
->setRiskyAllowed(true) | ||
->setUsingCache(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 |
---|---|---|
|
@@ -8,6 +8,7 @@ matrix: | |
- php: nightly | ||
include: | ||
- php: 7.1 | ||
- php: 7.2 | ||
- php: 7.1 | ||
env: deps=low | ||
- php: nightly | ||
|
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,39 @@ | ||
## | ||
## OTPHP | ||
## ----- | ||
## | ||
|
||
install: ## Install the dependencies (dev included) | ||
install: vendor | ||
|
||
## | ||
## Coding Standard | ||
## --------------- | ||
## | ||
|
||
cs: ## Fix coding standard | ||
cs: vendor | ||
vendor/bin/php-cs-fixer fix | ||
|
||
## | ||
## Tests | ||
## ----- | ||
## | ||
|
||
test: ## Run unit and functional test | ||
test: vendor | ||
vendor/bin/phpunit | ||
|
||
.PHONY: install tests help | ||
.DEFAULT_GOAL := help | ||
help: | ||
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/' | ||
|
||
|
||
|
||
composer.lock: composer.json | ||
composer update | ||
|
||
vendor: composer.lock | ||
composer install | ||
|
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
Oops, something went wrong.