Skip to content

Commit

Permalink
Namespaced, unit + functional tests, PSR2, Makefile...
Browse files Browse the repository at this point in the history
  • Loading branch information
zytzagoo committed Nov 10, 2017
1 parent dcf8030 commit a97a1ba
Show file tree
Hide file tree
Showing 28 changed files with 2,663 additions and 900 deletions.
24 changes: 24 additions & 0 deletions .editorconfig
@@ -0,0 +1,24 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
max_line_length = 120

[{.jshintrc,*.json,*.yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

# Use tabs for indentation (Makefiles require tabs)
[{Makefile,**.mk}]
indent_style = tab
13 changes: 13 additions & 0 deletions .gitattributes
@@ -0,0 +1,13 @@
# Ignore all test, docs etc with "export-ignore".
/.editorconfig export-ignore
/.distignore export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.styleci.yml export-ignore
/.travis.yml export-ignore
/phpcs.xml export-ignore
/phpcs.xml.dist export-ignore
/phpunit.xml export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
4 changes: 4 additions & 0 deletions .gitignore
@@ -1,4 +1,8 @@
nbproject
phpunit.xml
tests.php
composer.lock
vendor/
node_modules/
/.phpcs.cache
/coverage/
41 changes: 41 additions & 0 deletions .scrutinizer.yml
@@ -0,0 +1,41 @@
filter:
paths: ['src/*']

checks:
php: true

tools:
external_code_coverage: true

build:
nodes:
analysis:
environment:
mysql: false
postgresql: false
redis: false
mongodb: false
elasticsearch: false
memcached: false
neo4j: false
rabbitmq: false
php:
version: 7.1
cache:
disabled: false
directories:
- ~/.composer/cache
project_setup:
override: true
tests:
override:
- php-scrutinizer-run

#
#build_failure_conditions:
# - 'elements.rating(<= C).new.exists' # No new classes/methods with a rating of C or worse allowed
# - 'issues.label("coding-style").new.exists' # No new coding style issues allowed
# - 'issues.severity(>= MAJOR).new.exists' # New issues of major or higher severity
# - 'project.metric_change("scrutinizer.test_coverage", < 0)' # Code Coverage decreased from previous inspection
# - 'patches.label("Doc Comments").new.exists' # No new doc comments patches allowed
# - 'patches.label("Unused Use Statements").new.exists' # No new unused imports patches allowed
51 changes: 51 additions & 0 deletions .travis.yml
@@ -0,0 +1,51 @@
dist: trusty
language: php
sudo: false

cache:
apt: true
directories:
- $HOME/.composer/cache/files

php:
- 5.6
- 7.0
- 7.1
- 7.2
- nightly

matrix:
fast_finish: true
allow_failures:
- php: nightly

before_install:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
- composer self-update

install: travis_retry composer install --no-interaction

script:
- find src tests \( -name '*.php' \) -exec php -l {} \;
- vendor/bin/phpunit

jobs:
allow_failures:
- php: nightly
include:
- stage: Coverage
php: 7.1
before_script:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
script:
- ./vendor/bin/phpunit --coverage-clover ./clover.xml
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover ./clover.xml
after_success:
- bash <(curl -s https://codecov.io/bash) -f ./clover.xml
- stage: CodeStyle
php: 7.1
script:
- ./vendor/bin/phpcs -n
28 changes: 28 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,28 @@
# Change Log

## [Unreleased]
### Added
- n/a

### Changed
- n/a

### Fixed
- n/a

## [1.0.0] - 2017-11-xx
### Added
- Namespaced code
- Unit and functional tests
- Makefile to handle development dependencies
- Added Travis CI & Scrutinizer integration

### Changed
- Switched to PSR2 style

### Fixed
- Fixed a few edge cases (which tests revealed)

## [0.6] - 2009
### Added
- Initial release

0 comments on commit a97a1ba

Please sign in to comment.