Skip to content

Commit

Permalink
Merge pull request #8 from alongosz/update-php-cs-fixer-2.7.1
Browse files Browse the repository at this point in the history
EZP-28161: Update php-cs-fixer configuration to align with v2.7.1
  • Loading branch information
andrerom authored Nov 9, 2017
2 parents b4ed2fe + 8dda0ed commit 57db7b9
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 24 deletions.
55 changes: 32 additions & 23 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
<?php

return Symfony\CS\Config\Config::create()
->setUsingLinter(false)
->setUsingCache(true)
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'concat_with_spaces',
'-concat_without_spaces',
'-empty_return',
'-phpdoc_params',
'-phpdoc_separation',
'-phpdoc_to_comment',
'-spaces_cast',
'-blankline_after_open_tag',
'-single_blank_line_before_namespace',
])
->finder(
Symfony\CS\Finder\DefaultFinder::create()
// PHP-CS-Fixer 2.x syntax
return PhpCsFixer\Config::create()
->setRules(
[
'@Symfony' => true,
'@Symfony:risky' => true,
'concat_space' => ['spacing' => 'one'],
'array_syntax' => false,
'simplified_null_return' => false,
'phpdoc_align' => false,
'phpdoc_separation' => false,
'phpdoc_to_comment' => false,
'cast_spaces' => false,
'blank_line_after_opening_tag' => false,
'single_blank_line_before_namespace' => false,
'phpdoc_annotation_without_dot' => false,
'phpdoc_no_alias_tag' => false,
'space_after_semicolon' => false,
'yoda_style' => false,
'no_break_comment' => false,
]
)
->setRiskyAllowed(true)
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude([
'vendor',
'Resources'
])
->exclude(
[
'vendor',
'Resources',
]
)
->files()->name('*.php')
)
;
);
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
language: php

php:
- 7.1

# test only master and stable branches (+ Pull requests)
branches:
only:
- master
- /^\d.\d+$/

install:
# Disable XDebug for better performance
- phpenv config-rm xdebug.ini
# Avoid memory issues on composer install
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Get latest composer build
- travis_retry composer selfupdate
# Install packages
- travis_retry composer install --prefer-dist --no-interaction

script:
- vendor/bin/php-cs-fixer fix -v --dry-run --diff --show-progress=estimating

notifications:
email: false
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@
}
],
"require": {
"symfony/symfony": "~2.6"
"symfony/symfony": "~2.6 || ^3.3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.7.1"
},
"autoload": {
"psr-4": {
"EzSystems\\ShareButtonsBundle\\": ""
}
},
"scripts": {
"fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating"
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
Expand Down

0 comments on commit 57db7b9

Please sign in to comment.