Skip to content

Commit

Permalink
Addition of php-cs-fixer and bridge, updated style rules, travis tweaks.
Browse files Browse the repository at this point in the history
- Added "friendsofphp/php-cs-fixer:~2.0" development dep.
- Added "sllh/php-cs-fixer-styleci-bridge:~2.1" development dep to enable php-cs-fixer configuration directly from .styleci.yml config file.
- Updated "styleci.yml" file rule additions (on top of symfony preset):
  - combine_consecutive_unsets
  - linebreak_after_opening_tag
  - no_short_echo_tag
  - ordered_imports
  - phpdoc_order
  - php_unit_construct
  - php_unit_dedicate_assert
  - long_array_syntax
- Added "sort-packages" to "config" key in "composer.json"
- Updated "suggest" key descriptions in "composer.json" for clarity.
- Added travis fix for Symfony 2.3

travis fix

fixed travis

typo fix
  • Loading branch information
robfrawley committed Sep 9, 2016
1 parent e573cc0 commit ef0c92f
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 29 deletions.
30 changes: 30 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/*
* This file is part of the `liip/LiipImagineBundle` project.
*
* (c) https://github.com/liip/LiipImagineBundle/graphs/contributors
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

use SLLH\StyleCIBridge\ConfigBridge;

require_once __DIR__.'/vendor/autoload.php';

$headerString = <<<EOF
This file is part of the `liip/LiipImagineBundle` project.
(c) https://github.com/liip/LiipImagineBundle/graphs/contributors
For the full copyright and license information, please view the LICENSE.md
file that was distributed with this source code.
EOF;

$headerConfig = [ 'header_comment' => [ ] ];

$config = ConfigBridge::create();
$config->setRules(array_merge($config->getRules(), $headerConfig));

return $config;
21 changes: 20 additions & 1 deletion .styleci.yml
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
preset: symfony
---

preset: symfony

enabled:
- combine_consecutive_unsets
- linebreak_after_opening_tag
- no_short_echo_tag
- ordered_imports
- phpdoc_order
- php_unit_construct
- php_unit_dedicate_assert
- long_array_syntax

finder :
name : [ "*.php", "*.twig" ]
exclude : [ "vendor", "var" ]
path : [ "./" ]

...
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ matrix:
env: COMPOSER_FLAGS="--prefer-lowest"

before_install:
- sh -c 'if [ "${TRAVIS_PHP_VERSION}" != "hhvm" ]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;'
- sh -c 'if [ "${TRAVIS_PHP_VERSION}" != "hhvm" && "${TRAVIS_PHP_VERSION}" != "7.0" ]; then yes "" | pecl -q install -f mongo; fi;'
- sh -c 'if [ "${TRAVIS_PHP_VERSION}" != "hhvm" && "${TRAVIS_PHP_VERSION}" != "7.0" ]; then composer require --dev doctrine/mongodb-odm:~1.0 --no-update; fi;'
- sh -c 'if [ "${TRAVIS_PHP_VERSION}" != "hhvm" && "${TRAVIS_PHP_VERSION}" >= "5.4" ]; then composer require --dev league/flysystem:~1.0 --no-update; fi;'
- if [ "${TRAVIS_PHP_VERSION}" != "hhvm" ]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
- if [ "${SYMFONY_VERSION:0:3}" == "2.3" ]; then composer remove --dev friendsofphp/php-cs-fixer --no-update; fi;
- if [ "${TRAVIS_PHP_VERSION}" != "hhvm" ]; then composer require --dev league/flysystem:~1.0 --no-update; fi;
- if [ "${TRAVIS_PHP_VERSION}" != "hhvm" ] && [ "${TRAVIS_PHP_VERSION}" != "7.0" ]; then yes "" | pecl -q install -f mongo; fi;
- if [ "${TRAVIS_PHP_VERSION}" != "hhvm" ] && [ "${TRAVIS_PHP_VERSION}" != "7.0" ]; then composer require --dev doctrine/mongodb-odm:~1.0 --no-update; fi;
- composer self-update
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
- if [ "${SYMFONY_VERSION:-x}" != "x" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;

install: composer update --prefer-source $COMPOSER_FLAGS

Expand Down
44 changes: 21 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,44 @@
"require": {
"php": "^5.3.9|^7.0",
"imagine/Imagine": "^0.6.3,<0.7",
"symfony/finder": "~2.3|~3.0",
"symfony/filesystem": "~2.3|~3.0",
"symfony/options-resolver": "~2.3|~3.0",
"symfony/finder": "~2.3|~3.0",
"symfony/framework-bundle": "~2.3|~3.0",
"symfony/options-resolver": "~2.3|~3.0",
"symfony/process": "~2.3|~3.0"
},

"require-dev": {
"ext-gd": "*",
"amazonwebservices/aws-sdk-for-php": "~1.0",
"aws/aws-sdk-php": "~2.4",
"doctrine/cache": "~1.1",
"doctrine/orm": "~2.3",
"friendsofphp/php-cs-fixer": "~2.0",
"phpunit/phpunit": "~4.3",
"psr/log": "~1.0",
"sllh/php-cs-fixer-styleci-bridge": "~2.1",
"symfony/browser-kit": "~2.3|~3.0",
"symfony/yaml": "~2.3|~3.0",
"symfony/form": "~2.3|~3.0",
"symfony/console": "~2.3|~3.0",
"symfony/phpunit-bridge": "~2.3|~3.0",
"symfony/dependency-injection": "~2.3|~3.0",
"doctrine/orm": "~2.3",
"doctrine/cache": "~1.1",
"twig/twig": "~1.12",
"aws/aws-sdk-php": "~2.4",
"amazonwebservices/aws-sdk-for-php": "~1.0",
"psr/log": "~1.0",
"ext-gd": "*"
"symfony/form": "~2.3|~3.0",
"symfony/phpunit-bridge": "~2.3|~3.0",
"symfony/yaml": "~2.3|~3.0",
"twig/twig": "~1.12"
},

"suggest": {
"twig/twig": "If you'd want to use some handy twig filters, version 1.12 or greater required",
"aws/aws-sdk-php": "Add it if you'd like to use aws v2 or v3 resolver",
"amazonwebservices/aws-sdk-for-php": "Add it if you'd like to use aws v1 resolver",
"monolog/monolog": "If you'd want to write logs",
"league/flysystem": "If you'd want to use Flysystem binary loader"
"amazonwebservices/aws-sdk-for-php": "Required to use AWS version 1 cache resolver.",
"aws/aws-sdk-php": "Required to use AWS version 2/3 cache resolver.",
"league/flysystem": "Required to use FlySystem data loader or cache resolver.",
"monolog/monolog": "A psr/log compatible logger is required to enable logging.",
"twig/twig": "Required to use the provided Twig extension. Version 1.12 or greater needed."
},

"autoload": {
"psr-4": { "Liip\\ImagineBundle\\": "" }
},

"config": {
"bin-dir": "bin"
"bin-dir": "bin",
"sort-packages" : true
},

"extra": {
"branch-alias": {
"dev-master": "1.6.x-dev"
Expand Down

0 comments on commit ef0c92f

Please sign in to comment.