Skip to content

Commit

Permalink
Added EasyCodingStandard + lots of code fixes (#156)
Browse files Browse the repository at this point in the history
* travis: move coveralls here, decouple from package

* composer: use PSR4

* phpunit: simpler config

* travis: add ecs run

* composer: add ecs dev

* use standard vendor/bin directory for dependency bins, confuses with local bins and require gitignore handling

* ecs: add PSR2

* [cs] PSR2 spacing fixes

* [cs] PSR2 class name fix

* [cs] PHP7 fixes - return semicolon spaces, old rand functions, typehints

* [cs] fix less strict typehints

* fix typehints to make tests pass

* ecs: ignore typehint-less elements

* [cs] standardize arrays

* [cs] standardize docblock, remove unused comments

* [cs] use self where possible

* [cs] sort class elements, from public to private

* [cs] do not use yoda (found less yoda-cases, than non-yoda)

* space

* [cs] do not assign in condition

* [cs] use namespace imports if possible

* [cs] use ::class over strings

* [cs] fix defaults for arrays properties, properties and constants single spacing

* cleanup ecs comments

* [cs] use item per line in multi-items array

* missing line

* misc

* rebase
  • Loading branch information
Tomáš Votruba authored and akondas committed Nov 22, 2017
1 parent b1d40bf commit 726cf4c
Show file tree
Hide file tree
Showing 139 changed files with 3,199 additions and 1,633 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
/vendor/
humbuglog.*
/bin/phpunit
.coverage
.php_cs.cache
/bin/php-cs-fixer
/bin/coveralls
/build
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ matrix:
include:
- os: linux
php: '7.1'
env: DISABLE_XDEBUG="true"
env: DISABLE_XDEBUG="true" STATIC_ANALYSIS="true"

- os: linux
php: '7.2'
Expand All @@ -21,18 +21,20 @@ matrix:

before_install:
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then /usr/bin/env bash bin/prepare_osx_env.sh ; fi
- if [[ DISABLE_XDEBUG == "true" ]]; then phpenv config-rm xdebug.ini; fi
- if [[ $DISABLE_XDEBUG == "true" ]]; then phpenv config-rm xdebug.ini; fi

install:
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then /usr/bin/env bash bin/handle_brew_pkg.sh "${_PHP}" ; fi
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --dev --no-interaction --ignore-platform-reqs

script:
- bin/phpunit $PHPUNIT_FLAGS
- vendor/bin/phpunit $PHPUNIT_FLAGS
- if [[ $STATIC_ANALYSIS != "" ]]; then vendor/bin/ecs check src tests; fi

after_success:
- |
if [[ $PHPUNIT_FLAGS != "" ]]; then
php bin/coveralls -v
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar;
php coveralls.phar --verbose;
fi
11 changes: 5 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}
],
"autoload": {
"psr-0": {
"Phpml": "src/"
"psr-4": {
"Phpml\\": "src/Phpml"
}
},
"require": {
Expand All @@ -22,9 +22,8 @@
"require-dev": {
"phpunit/phpunit": "^6.0",
"friendsofphp/php-cs-fixer": "^2.4",
"php-coveralls/php-coveralls": "^1.0"
},
"config": {
"bin-dir": "bin"
"symplify/easy-coding-standard": "dev-master as 2.5",
"symplify/coding-standard": "dev-master as 2.5",
"symplify/package-builder": "dev-master#3604bea as 2.5"
}
}
Loading

0 comments on commit 726cf4c

Please sign in to comment.