<commit_before>sudo: false

language: php

branches:
  except:
    - /^release-\d+\.\d+\.\d+.*$/
    - /^ghgfk-.*$/

cache:
  directories:
    - $HOME/.composer/cache
    - $HOME/.local
    - zf-mkdoc-theme

env:
  global:
    - TESTS_ZEND_DB_ADAPTER_DRIVER_MYSQL_HOSTNAME=localhost
    - TESTS_ZEND_DB_ADAPTER_DRIVER_PGSQL_HOSTNAME=localhost
    - SITE_URL: https://zendframework.github.io/zend-db
    - GH_USER_NAME: "<NAME>"
    - GH_USER_EMAIL: <EMAIL>
    - GH_REF: github.com/zendframework/zend-db.git
    - secure: "<KEY>

matrix:
  fast_finish: true
  include:
    - php: 5.5
      env:
        - EXECUTE_CS_CHECK=true
    - php: 5.5
      env:
        - EVENT_MANAGER_VERSION:'^2.6.2'
        - HYDRATOR_VERSION='^1.1'
        - SERVICE_MANAGER_VERSION='^2.7.5'
    - php: 5.6
      env:
        - EXECUTE_TEST_COVERALLS=true
        - DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
        - PATH="$HOME/.local/bin:$PATH"
    - php: 5.6
      env:
        - EVENT_MANAGER_VERSION='^2.6.2'
        - HYDRATOR_VERSION='^1.1'
        - SERVICE_MANAGER_VERSION='^2.7.5'
    - php: 7
    - php: 7
      env:
        - EVENT_MANAGER_VERSION='^2.6.2'
        - HYDRATOR_VERSION='^1.1'
        - SERVICE_MANAGER_VERSION='^2.7.5'
    - php: hhvm
    - php: hhvm
      env:
        - EVENT_MANAGER_VERSION='^2.6.2'
        - HYDRATOR_VERSION='^1.1'
        - SERVICE_MANAGER_VERSION='^2.7.5'
  allow_failures:
    - php: hhvm

notifications:
  irc: "irc.freenode.org#zftalk.dev"
  email: false

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
  - if [[ $EVENT_MANAGER_VERSION != '' ]]; then composer require --dev --no-update "zendframework/zend-eventmanager:$EVENT_MANAGER_VERSION" ; fi
  - if [[ $EVENT_MANAGER_VERSION == '' ]]; then composer require --dev --no-update "zendframework/zend-eventmanager:^3.0" ; fi
  - if [[ $HYDRATOR_VERSION != '' ]]; then composer require --no-update "zendframework/zend-stdlib:^2.7" ; fi
  - if [[ $HYDRATOR_VERSION != '' ]]; then composer require --dev --no-update "zendframework/zend-hydrator:$HYDRATOR_VERSION" ; fi
  - if [[ $HYDRATOR_VERSION == '' ]]; then composer require --dev --no-update "zendframework/zend-hydrator:^2.1" ; fi
  - if [[ $SERVICE_MANAGER_VERSION != '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:$SERVICE_MANAGER_VERSION" ; fi
  - if [[ $SERVICE_MANAGER_VERSION == '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:^3.0.3" ; fi
  - echo "composer.json to install:"
  - cat composer.json

install:
  - travis_retry composer install --no-interaction --ignore-platform-reqs

before_script:
  - .ci/mysql_fixtures.sh
  - .ci/pgsql_fixtures.sh

script:
  - 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
  - if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi

after_success:
  - if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi

after_script:
  - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/coveralls ; fi<commit_msg>Use composer scripts in .travis.yml<commit_after>sudo: false

language: php

branches:
  except:
    - /^release-\d+\.\d+\.\d+.*$/
    - /^ghgfk-.*$/

cache:
  directories:
    - $HOME/.composer/cache
    - $HOME/.local
    - zf-mkdoc-theme

env:
  global:
    - TESTS_ZEND_DB_ADAPTER_DRIVER_MYSQL_HOSTNAME=localhost
    - TESTS_ZEND_DB_ADAPTER_DRIVER_PGSQL_HOSTNAME=localhost
    - SITE_URL: https://zendframework.github.io/zend-db
    - GH_USER_NAME: "<NAME>"
    - GH_USER_EMAIL: <EMAIL>
    - GH_REF: github.com/zendframework/zend-db.git
    - secure: "<KEY>

matrix:
  fast_finish: true
  include:
    - php: 5.5
      env:
        - CS_CHECK=true
    - php: 5.5
      env:
        - EVENT_MANAGER_VERSION:'^2.6.2'
        - HYDRATOR_VERSION='^1.1'
        - SERVICE_MANAGER_VERSION='^2.7.5'
    - php: 5.6
      env:
        - TEST_COVERAGE=true
        - DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
        - PATH="$HOME/.local/bin:$PATH"
    - php: 5.6
      env:
        - EVENT_MANAGER_VERSION='^2.6.2'
        - HYDRATOR_VERSION='^1.1'
        - SERVICE_MANAGER_VERSION='^2.7.5'
    - php: 7
    - php: 7
      env:
        - EVENT_MANAGER_VERSION='^2.6.2'
        - HYDRATOR_VERSION='^1.1'
        - SERVICE_MANAGER_VERSION='^2.7.5'
    - php: hhvm
    - php: hhvm
      env:
        - EVENT_MANAGER_VERSION='^2.6.2'
        - HYDRATOR_VERSION='^1.1'
        - SERVICE_MANAGER_VERSION='^2.7.5'
  allow_failures:
    - php: hhvm

notifications:
  irc: "irc.freenode.org#zftalk.dev"
  email: false

before_install:
  - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
  - composer self-update
  - if [[ $TEST_COVERAGE == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
  - if [[ $EVENT_MANAGER_VERSION != '' ]]; then composer require --dev --no-update "zendframework/zend-eventmanager:$EVENT_MANAGER_VERSION" ; fi
  - if [[ $EVENT_MANAGER_VERSION == '' ]]; then composer require --dev --no-update "zendframework/zend-eventmanager:^3.0" ; fi
  - if [[ $HYDRATOR_VERSION != '' ]]; then composer require --no-update "zendframework/zend-stdlib:^2.7" ; fi
  - if [[ $HYDRATOR_VERSION != '' ]]; then composer require --dev --no-update "zendframework/zend-hydrator:$HYDRATOR_VERSION" ; fi
  - if [[ $HYDRATOR_VERSION == '' ]]; then composer require --dev --no-update "zendframework/zend-hydrator:^2.1" ; fi
  - if [[ $SERVICE_MANAGER_VERSION != '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:$SERVICE_MANAGER_VERSION" ; fi
  - if [[ $SERVICE_MANAGER_VERSION == '' ]]; then composer require --dev --no-update "zendframework/zend-servicemanager:^3.0.3" ; fi
  - echo "composer.json to install:"
  - cat composer.json

install:
  - travis_retry composer install --no-interaction --ignore-platform-reqs

before_script:
  - .ci/mysql_fixtures.sh
  - .ci/pgsql_fixtures.sh

script:
  - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
  - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
  - if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi

after_success:
  - if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi

after_script:
  - if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi
{'fraction_non_alphanumeric': 0.16376306620209058, 'fraction_numerical': 0.0150093808630394, 'mean_word_length': 2.925828511309837, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1111069', 'n_tokens_mistral': 2926, 'n_tokens_neox': 2840, 'n_words': 507}