-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Base PHP-cs-fixer migration to version 2 plus style fix #1555
Merged
ruflin
merged 5 commits into
ruflin:master
from
massimilianobraglia:migrate_cs_fixer_to_version_2
Dec 24, 2018
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4f15fb2
Base PHP-cs-fixer migration to version 2 plus style fix
massimilianobraglia 84612d5
add php-cs-fixer only in 7.0, 7.1 and 7.2. Removed from PHP 7.3. Upda…
massimilianobraglia 41f890e
Separate step for linting in travis matrix. Readded phpdocumentor
massimilianobraglia 19cf2da
Updated CHANGELOG.md
massimilianobraglia fb63135
Update CHANGELOG with PR number.
ruflin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
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 |
---|---|---|
@@ -1,32 +1,26 @@ | ||
<?php | ||
|
||
$finder = Symfony\CS\Finder\DefaultFinder::create() | ||
->in(['lib', 'test']); | ||
$finder = PhpCsFixer\Finder::create() | ||
->exclude(['vendor', 'var']) | ||
->in([__DIR__]) | ||
; | ||
|
||
$config = Symfony\CS\Config\Config::create() | ||
->setUsingCache(true) | ||
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) | ||
->fixers([ | ||
// [contrib] Multi-line whitespace before closing semicolon are prohibited. | ||
'multiline_spaces_before_semicolon', | ||
// [contrib] There should be no blank lines before a namespace declaration. | ||
'no_blank_lines_before_namespace', | ||
// [contrib] Ordering use statements. | ||
'ordered_use', | ||
// [contrib] Annotations should be ordered so that param annotations come first, then throws annotations, then return annotations. | ||
'phpdoc_order', | ||
// [contrib] Arrays should use the short syntax. | ||
'short_array_syntax', | ||
// [contrib] Ensure there is no code on the same line as the PHP open tag. | ||
'newline_after_open_tag', | ||
// [contrib] Use null coalescing operator ?? where possible | ||
'ternary_to_null_coalescing', | ||
// [contrib] There should not be useless else cases. | ||
'no_useless_else', | ||
// [contrib] Use dedicated PHPUnit assertions for better error messages. | ||
$config = PhpCsFixer\Config::create() | ||
->setFinder($finder) | ||
->setRules([ | ||
'@PSR2' => true, | ||
'@Symfony' => true, | ||
'psr0' => false, | ||
'single_blank_line_before_namespace' => false, | ||
'ordered_imports' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'phpdoc_order' => true, | ||
'blank_line_after_namespace' => true, | ||
'ternary_to_null_coalescing' => true, | ||
'no_useless_else' => true, | ||
'@PHPUnit60Migration:risky' => true, | ||
//'php_unit_dedicate_assert' => ['target' => 'newest'], | ||
'php_unit_dedicate_assert' => ['target' => 'newest'], | ||
]) | ||
->finder($finder); | ||
; | ||
|
||
return $config; |
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
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
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 @@ | ||
# This image is the base image for the Elastica development and includes all parts which rarely change | ||
# PHP 7 Docker file with Composer installed | ||
FROM php:7.2 | ||
MAINTAINER Nicolas Ruflin <[email protected]> | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
cloc \ | ||
git \ | ||
graphviz \ | ||
libxslt-dev \ | ||
nano \ | ||
zip unzip \ | ||
wget | ||
# XSL and Graphviz for PhpDocumentor | ||
|
||
RUN docker-php-ext-install sockets xsl | ||
|
||
RUN rm -r /var/lib/apt/lists/* | ||
|
||
# Xdebug for coverage report | ||
RUN pecl install xdebug-2.6.1 | ||
|
||
RUN echo "memory_limit=1024M" >> /usr/local/etc/php/conf.d/memory-limit.ini | ||
RUN echo "date.timezone=UTC" >> /usr/local/etc/php/conf.d/timezone.ini | ||
|
||
# Install and setup composer | ||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
ENV COMPOSER_HOME /root/composer | ||
|
||
# Add composer bin to the environment | ||
ENV PATH=/root/composer/vendor/bin:$PATH | ||
|
||
COPY composer.json /root/composer/ | ||
|
||
RUN composer global remove --no-update phpdocumentor/phpdocumentor -vvv | ||
RUN composer global require --no-update friendsofphp/php-cs-fixer:^2.0 | ||
|
||
# Install development tools, prefer source removed as automatic fallback now | ||
RUN composer global install -vvv |
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 |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
"require": { | ||
"php": "^7.0", | ||
"phpdocumentor/phpdocumentor": "^2.9", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please keep this in? I need this to generate the docs :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok :) Probably I forgot to readd that one. |
||
"fabpot/php-cs-fixer": "1.11.*", | ||
"mayflower/php-codebrowser": "~1.1", | ||
"pdepend/pdepend": "^2.5", | ||
"phploc/phploc": "^4.0", | ||
|
@@ -23,4 +22,4 @@ | |
"sebastian/phpcpd": "~3.0", | ||
"squizlabs/php_codesniffer": "~3.3" | ||
} | ||
} | ||
} |
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
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,4 +1,5 @@ | ||
<?php | ||
|
||
namespace Elastica\Aggregation; | ||
|
||
use Elastica\Exception\InvalidException; | ||
|
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,4 +1,5 @@ | ||
<?php | ||
|
||
namespace Elastica\Aggregation; | ||
|
||
use Elastica\Exception\InvalidException; | ||
|
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
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
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
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
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
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
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
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I didn't notice that 🤔
Fixing..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still needs a fix ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed 😄