Skip to content

Commit

Permalink
Merge pull request #148 from noisebleed/feature/rework-travis-yml-for…
Browse files Browse the repository at this point in the history
…-new-platforms

Move execution of coveralls for PHP-5.6 only to address an issue in T…
  • Loading branch information
vitorbrandao committed Jan 9, 2016
2 parents 644edb6 + 92dd026 commit 4fc76af
Show file tree
Hide file tree
Showing 61 changed files with 408 additions and 821 deletions.
241 changes: 19 additions & 222 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,224 +4,6 @@ use Symfony\CS\Config\Config;
use Symfony\CS\Finder\DefaultFinder;
use Symfony\CS\FixerInterface;

/*
* List of available fixers:
*
* "psr0" [PSR-0]
* Classes must be in a path that matches their namespace, be at least one namespace deep, and the class name should
* match the file name.
*
* "encoding" [PSR-1]
* PHP code MUST use only UTF-8 without BOM (remove BOM).
*
* "short_tag" [PSR-1]
* PHP code must use the long <?php ?> tags or the short-echo <?= ?> tags; it must not use the other tag variations.
*
* "braces" [PSR-2]
* The body of each structure MUST be enclosed by braces. Braces should be properly placed. Body of braces should be
* properly indented.
*
* "elseif" [PSR-2]
* The keyword elseif should be used instead of else if so that all control keywords looks like single words.
*
* "eof_ending" [PSR-2]
* A file must always end with an empty line feed.
*
* "function_call_space" [PSR-2]
* When making a method or function call, there MUST NOT be a space between the method or function name and the opening
* parenthesis.
*
* "function_declaration" [PSR-2]
* Spaces should be properly placed in a function declaration.
*
* "indentation" [PSR-2]
* Code MUST use an indent of 4 spaces, and MUST NOT use tabs for indenting.
*
* "line_after_namespace" [PSR-2]
* There MUST be one blank line after the namespace declaration.
*
* "linefeed" [PSR-2]
* All PHP files must use the Unix LF (linefeed) line ending.
*
* "lowercase_constants" [PSR-2]
* The PHP constants true, false, and null MUST be in lower case.
*
* "lowercase_keywords" [PSR-2]
* PHP keywords MUST be in lower case.
*
* "method_argument_space" [PSR-2]
* In method arguments and method call, there MUST NOT be a space before each comma and there MUST be one space after
* each comma.
*
* "multiple_use" [PSR-2]
* There MUST be one use keyword per declaration.
*
* "parenthesis" [PSR-2]
* There MUST NOT be a space after the opening parenthesis. There MUST NOT be a space before the closing parenthesis.
*
* "php_closing_tag" [PSR-2]
* The closing ?> tag MUST be omitted from files containing only PHP.
*
* "single_line_after_imports" [PSR-2] Each namespace use MUST go on its own line and there MUST be one blank line after
* the use statements block.
*
* "trailing_spaces" [PSR-2]
* Remove trailing whitespace at the end of non-blank lines.
*
* "visibility" [PSR-2]
* Visibility MUST be declared on all properties and methods; abstract and final MUST be declared before the visibility;
* static MUST be declared after the visibility.
*
* "concat_without_spaces" [symfony]
* Concatenation should be used without spaces.
*
* "double_arrow_multiline_whitespaces" [symfony]
* Operator => should not be surrounded by multi-line whitespaces.
*
* "duplicate_semicolon" [symfony]
* Remove duplicated semicolons.
*
* "empty_return" [symfony]
* A return statement wishing to return nothing should be simply "return".
*
* "extra_empty_lines" [symfony]
* Removes extra empty lines.
*
* "include" [symfony]
* Include and file path should be divided with a single space. File path should not be placed under brackets.
*
* "join_function" [symfony]
* Implode function should be used instead of join function.
*
* "multiline_array_trailing_comma" [symfony]
* PHP multi-line arrays should have a trailing comma.
*
* "namespace_no_leading_whitespace" [symfony]
* The namespace declaration line shouldn't contain leading whitespace.
*
* "new_with_braces" [symfony]
* All instances created with new keyword must be followed by braces.
*
* "no_blank_lines_after_class_opening" [symfony]
* There should be no empty lines after class opening brace.
*
* "no_empty_lines_after_phpdocs" [symfony]
* There should not be blank lines between docblock and the documented element.
*
* "object_operator" [symfony]
* There should not be space before or after object T_OBJECT_OPERATOR.
*
* "operators_spaces" [symfony]
* Operators should be surrounded by at least one space.
*
* "phpdoc_indent" [symfony]
* Docblocks should have the same indentation as the documented subject.
*
* "phpdoc_no_empty_return" [symfony]
* @return void and @return null annotations should be omitted from phpdocs.
*
* "phpdoc_no_package" [symfony]
* @package and @subpackage annotations should be omitted from phpdocs.
*
* "phpdoc_params" [symfony]
* All items of the @param, @throws, @return, @var, and @type phpdoc tags must be aligned vertically.
*
* "phpdoc_separation" [symfony]
* Annotations in phpdocs should be grouped together so that annotations of the same type immediately follow each other,
* and annotations of a different type are separated by a single blank line.
*
* "phpdoc_short_description" [symfony]
* Phpdocs short descriptions should end in either a full stop, exclamation mark, or question mark.
*
* "phpdoc_to_comment" [symfony]
* Docblocks should only be used on structural elements.
*
* "phpdoc_trim" [symfony]
* Phpdocs should start and end with content, excluding the very fist and last line of the docblocks.
*
* "phpdoc_type_to_var" [symfony]
* @type should always be written as @var.
*
* "phpdoc_var_without_name" [symfony]
* @var and @type annotations should not contain the variable name.
*
* "remove_leading_slash_use" [symfony]
* Remove leading slashes in use clauses.
*
* "remove_lines_between_uses" [symfony]
* Removes line breaks between use statements.
*
* "return" [symfony]
* An empty line feed should precede a return statement.
*
* "single_array_no_trailing_comma" [symfony]
* PHP single-line arrays should not have trailing comma.
*
* "single_blank_line_before_namespace" [symfony]
* There should be exactly one blank line before a namespace declaration.
*
* "spaces_before_semicolon" [symfony]
* Single-line whitespace before closing semicolon are prohibited.
*
* "spaces_cast" [symfony]
* A single space should be between cast and variable.
*
* "standardize_not_equal" [symfony]
* Replace all <> with !=.
*
* "ternary_spaces" [symfony]
* Standardize spaces around ternary operator.
*
* "unused_use" [symfony]
* Unused use statements must be removed.
*
* "whitespacy_lines" [symfony]
* Remove trailing whitespace at the end of blank lines.
*
* "align_double_arrow" [contrib]
* Align double arrow symbols in consecutive lines.
*
* "align_equals" [contrib]
* Align equals symbols in consecutive lines.
*
* "concat_with_spaces" [contrib]
* Concatenation should be used with at least one whitespace around.
*
* "ereg_to_preg" [contrib]
* Replace deprecated ereg regular expression functions with preg. Warning! This could change code behavior.
*
* "header_comment" [contrib]
* Add, replace or remove header comment.
*
* "multiline_spaces_before_semicolon" [contrib]
* Multi-line whitespace before closing semicolon are prohibited.
*
* "no_blank_lines_before_namespace" [contrib]
* There should be no blank lines before a namespace declaration.
*
* "ordered_use" [contrib]
* Ordering use statements.
*
* "php4_constructor" [contrib]
* Convert PHP4-style constructors to __construct. Warning! This could change code behavior.
*
* "phpdoc_order" [contrib]
* Annotations in phpdocs should be ordered so that param annotations come first, then throws annotations, then
* return annotations.
*
* "phpdoc_var_to_type" [contrib]
* @var should always be written as @type.
*
* "short_array_syntax" [contrib]
* PHP array's should use the PHP 5.4 short-syntax.
*
* "strict" [contrib]
* Comparison should be strict. Warning! This could change code behavior.
*
* "strict_param" [contrib]
* Functions should be used with $strict param. Warning! This could change code behavior.
*/

// Files and directories that will be scanned
$finder = DefaultFinder::create()
->exclude([
Expand All @@ -237,14 +19,18 @@ $config = Config::create()
->level(FixerInterface::PSR2_LEVEL)
->fixers(
[
'align_double_arrow',
'array_element_no_space_before_comma',
'array_element_white_space_after_comma',
'blankline_after_open_tag',
'concat_with_spaces',
'double_arrow_multiline_whitespaces',
'duplicate_semicolon',
'empty_return',
'extra_empty_lines',
'include',
'join_function',
'list_commas',
'method_argument_default_value',
'multiline_array_trailing_comma',
'multiline_spaces_before_semicolon',
'namespace_no_leading_whitespace',
Expand All @@ -258,26 +44,37 @@ $config = Config::create()
'phpdoc_no_package',
'phpdoc_order',
'phpdoc_params',
'phpdoc_scalar',
'phpdoc_separation',
'phpdoc_short_description',
'phpdoc_to_comment',
'phpdoc_trim',
'phpdoc_type_to_var',
'phpdoc_types',
'phpdoc_var_without_name',
'print_to_echo',
'remove_leading_slash_use',
'remove_lines_between_uses',
'return',
'self_accessor',
// 'short_array_syntax',
'short_bool_cast',
'single_array_no_trailing_comma',
'single_blank_line_before_namespace',
// 'single_quote',
'spaces_before_semicolon',
'spaces_cast',
'standardize_not_equal',
'ternary_spaces',
'trim_array_spaces',
'trailing_spaces',
'unneeded_control_parentheses',
'unused_use',
'whitespacy_lines',
])
->finder($finder)
->setUsingCache(true);
]
)
->setUsingLinter(true)
->setUsingCache(true)
->finder($finder);

return $config;
46 changes: 32 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,52 @@
sudo: false

language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7
- hhvm
cache:
directories:
- $HOME/.composer/cache
- vendor

matrix:
fast_finish: true
include:
- php: 5.4
env:
- EXECUTE_CS_CHECK=true
- php: 5.5
env:
- EXECUTE_CS_CHECK=true
- php: 5.6
env:
- EXECUTE_TEST_COVERALLS=true
- php: 7
- php: hhvm
allow_failures:
- php: 7
- php: hhvm

before_install:
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- composer self-update
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi

install:
- if [[ $TRAVIS_PHP_VERSION != '5.6' && $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != 'hhvm-nightly' && $TRAVIS_PHP_VERSION != '7' ]]; then phpenv config-rm xdebug.ini; fi
# Set the COMPOSER_ROOT_VERSION to the right version according to the branch being built
- if [ "$TRAVIS_BRANCH" = "master" ]; then export COMPOSER_ROOT_VERSION=dev-master; else export COMPOSER_ROOT_VERSION="$TRAVIS_BRANCH".x-dev; fi;
- composer --prefer-source --no-interaction install
- travis_retry composer install --no-interaction --ignore-platform-reqs
- composer info -i

script:
- mkdir -p build/logs
- php vendor/bin/phpunit -c phpunit.xml.dist
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; fi
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then ./vendor/bin/phpunit ; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/php-cs-fixer fix -v --diff --dry-run ; fi

after_script:
- php vendor/bin/coveralls -v
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/coveralls ; fi

notifications:
irc: "irc.freenode.org#ppi"
webhooks:
urls:
- https://webhooks.gitter.im/e/fc85ea3e366a33e217d5
on_success: change
on_failure: always
on_start: false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Version **2.1.0-DEV**
[![Dependency Status](https://www.versioneye.com/php/ppi:framework/dev-develop/badge.png)](https://www.versioneye.com/php/ppi:framework/dev-develop)
[![License](https://poser.pugx.org/ppi/framework/license.png)](https://packagist.org/packages/ppi/framework)

[PPI][@website] is the the PHP Interoperability Framework. It provides an equal and open platform to empower PHP developers to pick the best tools from the best PHP frameworks
[PPI][@website] is the PHP Interoperability Framework. It provides an equal and open platform to empower PHP developers to pick the best tools from the best PHP frameworks

PPI bootstraps framework components for you from the top frameworks such as ZendFramework2, Symfony2, Laravel4 and FuelPHP.

Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
}
],
"require": {
"php": ">=5.4",
"psr/log": "^1.0",
"psr/http-message": "^1.0",
"symfony/class-loader": "^2.7",
Expand All @@ -45,8 +46,7 @@
},
"require-dev": {
"fabpot/php-cs-fixer": "^1.5",
"phpunit/phpunit": "~4.0",
"satooshi/php-coveralls": "dev-master"
"phpunit/phpunit": "~4.0"
},
"suggest": {
"roave/security-advisories": "Prevents installation of composer packages with known security vulnerabilities"
Expand All @@ -61,5 +61,8 @@
"branch-alias": {
"dev-master": "2.1-dev"
}
},
"scripts": {
"coveralls": ".bin/coveralls"
}
}
Loading

0 comments on commit 4fc76af

Please sign in to comment.